summaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2017-01-31 11:58:04 +0100
committerPaul Lemire <paul.lemire@kdab.com>2017-01-31 14:09:58 +0000
commit7416cf5ecff88cff4ab312271322d8fb281cf68f (patch)
treea1d5fcd38757e412037320407630c260e0149917 /tests/manual
parentc35f8e7c5f573fcc89b3042157d5843d9322ac90 (diff)
animation-keyframe-simple updated to use a nested blending tree
Change-Id: I4db83a3f9c3e867269147298d204bb90c1193631 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/animation-keyframe-simple/main.qml71
1 files changed, 71 insertions, 0 deletions
diff --git a/tests/manual/animation-keyframe-simple/main.qml b/tests/manual/animation-keyframe-simple/main.qml
index e7db8b30b..328d8c7b2 100644
--- a/tests/manual/animation-keyframe-simple/main.qml
+++ b/tests/manual/animation-keyframe-simple/main.qml
@@ -175,6 +175,77 @@ DefaultSceneEntity {
]
}
+ Entity {
+ id: cube3
+
+ components: [
+ Transform {
+ id: cube3Transform
+ translation: Qt.vector3d(2.5, 0, 2)
+ onTranslationChanged: console.log("t = " + translation)
+ },
+ CuboidMesh {
+ },
+ PhongMaterial {
+ id: cube3Material
+ ambient: Qt.rgba(0.8, 0.8, 0.8, 1.0)
+ diffuse: "green"
+ shininess: 50
+ },
+ ObjectPicker {
+ onClicked: blendedAnimator3.running = true
+ },
+ BlendedClipAnimator {
+ id: blendedAnimator3
+ loops: 2
+
+ onRunningChanged: console.log("running = " + running)
+
+ blendTree: LerpBlend {
+ blendFactor: 0.5
+ AddBlend {
+ blendFactor: 0.5
+ clips: [
+ AnimationClip {
+ source: "pulsing-moving-cube.json"
+ onDurationChanged: console.log("duration = " + duration)
+ },
+ AnimationClip {
+ source: "pulsing-cube-additive.json"
+ onDurationChanged: console.log("duration = " + duration)
+ }]
+ }
+ 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: cube3Transform; property: "translation" },
+ ChannelMapping { channelName: "Rotation"; target: cube3Transform; property: "rotation" },
+ ChannelMapping { channelName: "Scaling"; target: cube3Transform; property: "scale3D" },
+ ChannelMapping { channelName: "Diffuse Color"; target: cube3Transform; property: "diffuse" }
+ ]
+ }
+ }
+ ]
+ }
+
camera: Camera {
position: Qt.vector3d(10, 3, 15)