0 votes

Hello,

In my project I have to play imported from Blender animations (BOTH TRANSFORMS ANIMATION AND SHAPEKEYS) simultaneously.

My scene contains:

mesh (MeshInstance, is the one for the tree animation)
AnimationPlayer (sets as AnimationPlayer of tree node)
AnimationTree

The problem is that after adding node AnimationTree and making it as TreeRoot AnimationNodeBlendTree in this form:

Animation (shapekeys) --->
Blend2(blend_amount set to 0.5) ---> TimeScale ---> Output
Animation (transforms) --->

(Allowing me to play both animations simultaneously and control their speed)

I don't know how to set up everything correctly for both animations to start from the beginning.

If the code doesn't set anything at all, the initial state of animations is almost random (not the first frame).

If I set it from the code like that: (In Ready function)

AnimationPlayer.play("pageturn-shapekeys")
AnimationPlayer.seek(0, true)
AnimationPlayer.stop()
AnimationPlayer.play("pageturn-transform")
AnimationPlayer.seek(0, true)
AnimationPlayer.stop()

This initial state is close to what it should be but it's not perfectly 1 frame of both animations.

The interesting thing is that when you put the whole tree back and forward play, like that:

AnimationTree["parameters/TimeScale/scale"] = 1
AnimationTree.active = true

and after finish:

AnimationTree["parameters/TimeScale/scale"] = -1
AnimationTree.active = true

The first frame is correct.

The latest stable Godot and the latest stable Blender, I transfer data using GLTF (separated) and import with separate objects+materials+animations.

So how to set the animations to ALWAYS start from the beginning in this configuration?

asked May 19 in Engine by beetbeet (38 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.