From 0f3b43de4988bdbb1029ac6b9ca97e58bb1f6080 Mon Sep 17 00:00:00 2001 From: smix8 <52464204+smix8@users.noreply.github.com> Date: Sat, 17 Apr 2021 19:10:35 +0200 Subject: [PATCH] doc AnimationNodeTimeSeek clarify usage and code example doc AnimationNodeTimeSeek clarify usage and code example (cherry picked from commit 274a98b4102d00e7c2ee45111d6a3ea29ca5d589) --- tutorials/animation/animation_tree.rst | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/tutorials/animation/animation_tree.rst b/tutorials/animation/animation_tree.rst index e3a7b0ce9..cc669838f 100644 --- a/tutorials/animation/animation_tree.rst +++ b/tutorials/animation/animation_tree.rst @@ -96,7 +96,30 @@ This node will execute a sub-animation and return once it finishes. Blend times Seek ^^^^ -This node can be used to cause a seek command to happen to any sub-children of the graph. After setting the time, this value returns to -1. +This node can be used to cause a seek command to happen to any sub-children of the animation graph. Use this node type to play an ``Animation`` from the start or a certain playback position inside the ``AnimationNodeBlendTree``. + +After setting the time and changing the animation playback, the seek node automatically goes into sleep mode on the next process frame by setting its ``seek_position`` value to ``-1.0``. + +.. tabs:: + .. code-tab:: gdscript GDScript + + # Play child animation from the start. + anim_tree.set("parameters/Seek/seek_position", 0.0) + # Alternative syntax (same result as above). + anim_tree["parameters/Seek/seek_position"] = 0.0 + + # Play child animation from 12 second timestamp. + anim_tree.set("parameters/Seek/seek_position", 12.0) + # Alternative syntax (same result as above). + anim_tree["parameters/Seek/seek_position"] = 12.0 + + .. code-tab:: csharp + + // Play child animation from the start. + animTree.Set("parameters/Seek/seek_position", 0.0); + + // Play child animation from 12 second timestamp. + animTree.Set("parameters/Seek/seek_position", 12.0); TimeScale ^^^^^^^^^