From bbecb4a4ffe06e7f96c108995bc5e75614eaa963 Mon Sep 17 00:00:00 2001 From: Mike Krus Date: Fri, 25 Sep 2020 10:41:24 +0100 Subject: Fix animation not running Previous fix for compile issue forgot to account for the fact that the data changes after being registered with the class. Change-Id: Ice5238221f190f758ec3f25d883c56877c185e1c Reviewed-by: Sean Harmer --- tests/manual/animation-keyframe-simple/CMakeLists.txt | 2 +- tests/manual/animation-keyframe-simple/main.qml | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'tests/manual') diff --git a/tests/manual/animation-keyframe-simple/CMakeLists.txt b/tests/manual/animation-keyframe-simple/CMakeLists.txt index 2769f5fa0..b15ee1b9f 100644 --- a/tests/manual/animation-keyframe-simple/CMakeLists.txt +++ b/tests/manual/animation-keyframe-simple/CMakeLists.txt @@ -29,7 +29,7 @@ qt_add_resource(animation-keyframe-simple "main" FILES ${main_resource_files} ) - +target_sources(animation-keyframe-simple PRIVATE ${main_resource_files}) #### Keys ignored in scope 1:.:.:animation-keyframe-simple.pro:: # OTHER_FILES = "main.qml" "DefaultSceneEntity.qml" diff --git a/tests/manual/animation-keyframe-simple/main.qml b/tests/manual/animation-keyframe-simple/main.qml index 9246f2467..b75b99c54 100644 --- a/tests/manual/animation-keyframe-simple/main.qml +++ b/tests/manual/animation-keyframe-simple/main.qml @@ -77,14 +77,15 @@ DefaultSceneEntity { ObjectPicker { onClicked: { if (animator.running == false) { - animator.running = true; + animator.normalizedTime = 0 + animator.running = true } else { switch (pick.button) { case PickEvent.RightButton: - animationClock.playbackRate *= 2.0; + animationClock.playbackRate *= 2.0 break; case PickEvent.LeftButton: - animationClock.playbackRate /= 2.0; + animationClock.playbackRate /= 2.0 break; default: break; @@ -103,7 +104,7 @@ DefaultSceneEntity { } clip: AnimationClipLoader { - source: "cubeanimation.json" + source: "qrc:///cubeanimation.json" onDurationChanged: console.log("duration = " + duration) } -- cgit v1.2.3