You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/animation/animation_tree.rst
+42Lines changed: 42 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -188,6 +188,48 @@ Transitions also have a few properties. Click any transition and it will be disp
188
188
* *Priority* is used together with the ``travel()`` function from code (more on this later). Lower priority transitions are preferred when travelling through the tree.
189
189
* *Disabled* toggles disabling this transition (when disabled, it will not be used during travel or auto advance).
190
190
191
+
For better blending
192
+
-------------------
193
+
194
+
In Godot 4.0+, in order for the blending results to be deterministic (reproducible and always consistent),
195
+
the blended property values must have a specific initial value.
196
+
For example, in the case of two animations to be blended, if one animation has a property track and the other does not,
197
+
the blended animation is calculated as if the latter animation had a property track with the initial value.
198
+
199
+
When using Position/Rotation/Scale 3D tracks for Skeleton3D bones, the initial value is Bone Rest.
200
+
For other properties, the initial value is ``0`` and if the track is present in the ``RESET`` animation,
201
+
the value of its first keyframe is used instead.
202
+
203
+
For example, the following AnimationPlayer has two animations, but one of them lacks a Property track for Position.
204
+
205
+
.. image:: img/blending1.webp
206
+
207
+
This means that the animation lacking that will treat those Positions as ``Vector2(0, 0)``.
208
+
209
+
.. image:: img/blending2.webp
210
+
211
+
This problem can be solved by adding a Property track for Position as an initial value to the ``RESET`` animation.
212
+
213
+
.. image:: img/blending3.webp
214
+
215
+
.. image:: img/blending4.webp
216
+
217
+
.. note:: Be aware that the ``RESET`` animation exists to define the default pose when loading an object originally.
218
+
It is assumed to have only one frame and is not expected to be played back using the timeline.
219
+
220
+
Also keep in mind that the Rotation 3D tracks and the Property tracks for 2D rotation
221
+
with Interpolation Type set to Linear Angle or Cubic Angle will prevent rotation of more than 180 degrees
222
+
from the initial value as blended animation.
223
+
224
+
This can be useful for Skeleton3Ds to prevent the bones penetrating the body when blending animations.
225
+
Therefore, Skeleton3D's Bone Rest values should be as close to the midpoint of the movable range as possible.
226
+
**This means that for humanoid models, it is preferable to import them in a T-pose**.
227
+
228
+
.. image:: img/blending5.webp
229
+
230
+
You can see that the shortest rotation path from Bone Rests is prioritized rather than the shortest rotation path between animations.
231
+
232
+
If you need to rotate Skeleton3D itself more than 180 degrees by blend animations for movement, you can use Root Motion.
0 commit comments