diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2017-01-29 12:21:50 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-01-29 18:56:05 +0000 |
commit | c3ca703edce017feb384984efd4b3c4e4a1227c0 (patch) | |
tree | 8f50e0e61fc79591e7f935171e71797c3255d263 /tests/manual/animation-keyframe-simple/main.qml | |
parent | 9efbf9abd5452dd2c05250449efe1abf5887f481 (diff) |
Update animation-keyframe-simple manual test with blend trees
Change-Id: I8cea944d920926d6213ad6ef0e72b97385259d83
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'tests/manual/animation-keyframe-simple/main.qml')
-rw-r--r-- | tests/manual/animation-keyframe-simple/main.qml | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/manual/animation-keyframe-simple/main.qml b/tests/manual/animation-keyframe-simple/main.qml index ad9e59659..a16de3f17 100644 --- a/tests/manual/animation-keyframe-simple/main.qml +++ b/tests/manual/animation-keyframe-simple/main.qml @@ -62,6 +62,63 @@ DefaultSceneEntity { ] } + Entity { + id: sphere + + components: [ + Transform { + id: sphereTransform + translation: Qt.vector3d(5, 0, 0) + onTranslationChanged: console.log("t = " + translation) + }, + SphereMesh { + }, + PhongMaterial { + id: sphereMaterial + ambient: Qt.rgba(0.02, 0.02, 0.02, 1.0) + diffuse: "red" + shininess: 50 + }, + ObjectPicker { + onClicked: blendedAnimator.running = true + }, + BlendedClipAnimator { + id: blendedAnimator + + onRunningChanged: console.log("running = " + running) + + blendTree: LerpBlend { + blendFactor: 0.5 + clips: [ + AnimationClip { + source: "cubeanimation.json" + onDurationChanged: console.log("duration = " + duration) + }, + AnimationClip { + source: "pulsing-moving-cube.json" + onDurationChanged: console.log("duration = " + duration) + }] + } + + + // By default introspect parent Entity and try + // to map fcurve groups to properties of QTransform + // mapping: AutomaticAnimationMapping {} + + // To do more, we can be explicit + channelMapper: ChannelMapper { + mappings: [ + ChannelMapping { channelName: "Location"; target: sphereTransform; property: "translation" }, + ChannelMapping { channelName: "Rotation"; target: sphereTransform; property: "rotation" }, + ChannelMapping { channelName: "Scaling"; target: sphereTransform; property: "scale3D" }, + ChannelMapping { channelName: "Diffuse Color"; target: sphereMaterial; property: "diffuse" } + ] + } + } + ] + } + + camera: Camera { position: Qt.vector3d(10, 3, 15) viewCenter: Qt.vector3d(2.5, 1, 0) |