summaryrefslogtreecommitdiffstats
path: root/editor/plugins/animation_blend_tree_editor_plugin.cpp
diff options
context:
space:
mode:
authorSilc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com>2024-01-08 06:08:10 +0900
committerSilc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com>2024-03-20 22:52:26 +0900
commit6dd410854c0a9bab155ba020a1e5055f7384f453 (patch)
treea29a616f8b4f21505053997cdea3920d67077705 /editor/plugins/animation_blend_tree_editor_plugin.cpp
parentfe01776f05b1787b28b4a270d53037a3c25f4ca2 (diff)
downloadredot-engine-6dd410854c0a9bab155ba020a1e5055f7384f453.tar.gz
Rework AnimationNode process for retrieving the semantic time info
Diffstat (limited to 'editor/plugins/animation_blend_tree_editor_plugin.cpp')
-rw-r--r--editor/plugins/animation_blend_tree_editor_plugin.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp
index 0412141775..bda2cb666b 100644
--- a/editor/plugins/animation_blend_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp
@@ -256,10 +256,6 @@ void AnimationNodeBlendTreeEditor::update_graph() {
options.push_back(F);
}
- if (tree->has_animation(anim->get_animation())) {
- pb->set_max(tree->get_animation(anim->get_animation())->get_length());
- }
-
pb->set_show_percentage(false);
pb->set_custom_minimum_size(Vector2(0, 14) * EDSCALE);
animations[E] = pb;
@@ -994,9 +990,10 @@ void AnimationNodeBlendTreeEditor::_notification(int p_what) {
if (tree->has_animation(an->get_animation())) {
Ref<Animation> anim = tree->get_animation(an->get_animation());
if (anim.is_valid()) {
- E.value->set_max(anim->get_length());
//StringName path = AnimationTreeEditor::get_singleton()->get_base_path() + E.input_node;
- StringName time_path = AnimationTreeEditor::get_singleton()->get_base_path() + String(E.key) + "/time";
+ StringName length_path = AnimationTreeEditor::get_singleton()->get_base_path() + String(E.key) + "/current_length";
+ StringName time_path = AnimationTreeEditor::get_singleton()->get_base_path() + String(E.key) + "/current_position";
+ E.value->set_max(tree->get(length_path));
E.value->set_value(tree->get(time_path));
}
}