summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-01-02 11:01:13 +0100
committerGitHub <noreply@github.com>2021-01-02 11:01:13 +0100
commit7a16efc88596caa5e794d1eb52c599d706b2457c (patch)
tree750f7530b630e7d5b5a4e49528895d9569ee2072
parentf29795c0e155e2882421abad42b56a4645883eb5 (diff)
parent674fb52f52f6592c71de319fb4e3fa52be6c136c (diff)
Merge pull request #42188 from Eoin-ONeill-Yokai/animationstateplayback/missing_binds
AnimationStateMachinePlayback: Added Missing Method Bindings
-rw-r--r--doc/classes/AnimationNodeStateMachinePlayback.xml7
-rw-r--r--scene/animation/animation_node_state_machine.cpp2
2 files changed, 9 insertions, 0 deletions
diff --git a/doc/classes/AnimationNodeStateMachinePlayback.xml b/doc/classes/AnimationNodeStateMachinePlayback.xml
index 60ff425cdb..4dc88ffa56 100644
--- a/doc/classes/AnimationNodeStateMachinePlayback.xml
+++ b/doc/classes/AnimationNodeStateMachinePlayback.xml
@@ -35,6 +35,13 @@
Returns the current travel path as computed internally by the A* algorithm.
</description>
</method>
+ <method name="get_current_play_position" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Returns the playback position within the current animation state.
+ </description>
+ </method>
<method name="is_playing" qualifiers="const">
<return type="bool">
</return>
diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp
index 2e2ae8c7d2..ef9f531f04 100644
--- a/scene/animation/animation_node_state_machine.cpp
+++ b/scene/animation/animation_node_state_machine.cpp
@@ -495,6 +495,8 @@ void AnimationNodeStateMachinePlayback::_bind_methods() {
ClassDB::bind_method(D_METHOD("stop"), &AnimationNodeStateMachinePlayback::stop);
ClassDB::bind_method(D_METHOD("is_playing"), &AnimationNodeStateMachinePlayback::is_playing);
ClassDB::bind_method(D_METHOD("get_current_node"), &AnimationNodeStateMachinePlayback::get_current_node);
+ ClassDB::bind_method(D_METHOD("get_current_play_position"), &AnimationNodeStateMachinePlayback::get_current_play_pos);
+ ClassDB::bind_method(D_METHOD("get_current_length"), &AnimationNodeStateMachinePlayback::get_current_length);
ClassDB::bind_method(D_METHOD("get_travel_path"), &AnimationNodeStateMachinePlayback::get_travel_path);
}