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
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -188,6 +188,47 @@ 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+, for blending results consistently, the property values to be blended always have a specific initial value.
195
+
For example, in the case of two animations to be blended, if one animation has a property track and the other does not,
196
+
the blended animation is calculated as if the latter animation had a property track with the initial value.
197
+
198
+
When using Position/Rotation/Scale 3D tracks for Skeleton3D bones, the initial value is Bone Rest.
199
+
For other properties, the initial value is ``0`` (exactly the value of ``zero()`` as Variant)
200
+
and if the track is present in the ``RESET`` animation, the value of its first keyframe is used instead.
201
+
202
+
For example, the following AnimationPlayer has two animations, but one of them lacks a Property track for Position.
203
+
204
+
.. image:: img/blending1.png
205
+
206
+
This means that the animation lacking that will treat those Positions as ``Vector2(0, 0)``.
207
+
208
+
.. image:: img/blending2.gif
209
+
210
+
This problem can be solved by adding a Property track for Position as an initial value to the RESET animation.
211
+
212
+
.. image:: img/blending3.png
213
+
214
+
.. image:: img/blending4.gif
215
+
216
+
.. note:: Be aware that the RESET animation exists to define the default pose when loading an object originally.
217
+
It is assumed to have only one frame and is not expected to be played back using the timeline.
218
+
219
+
Also keep in mind that the Rotation 3D tracks and the Property tracks for 2D rotation
220
+
with Interpolation Type set to Linear Angle or Cubic Angle will prevent rotation more than 180 degrees
221
+
from the initial value as blended animation.
222
+
223
+
This behavior is useful for Skeleton3D to prevent the bones penetrating the body when blend animations.
224
+
Therefore, Skeleton3D's Bone Rest values should be as close to the midpoint of the movable range as possible.
225
+
**This means that for humanoid models, it is preferable to import them with T-pose**.
226
+
227
+
.. image:: img/blending5.gif
228
+
229
+
You can see that the shortest rotation path from Bone Rests is prioritized rather than the shortest rotation path between animations.
230
+
231
+
If you need to rotate Skeleton3D itself more than 180 degrees by blend animations for movement, you can use Root Motion.
0 commit comments