diff options
author | Saracen <SaracenOne@gmail.com> | 2024-09-28 02:31:09 +0100 |
---|---|---|
committer | Saracen <SaracenOne@gmail.com> | 2024-09-28 06:52:05 +0100 |
commit | 77e803f2f38ed54b66442336e64264decede1c8e (patch) | |
tree | e5aac205baf1591ff1ac81dc30e6bc7e6224a6dc /editor | |
parent | 506d6e427a4eecfc1e5e5ee1180019a876119701 (diff) | |
download | redot-engine-77e803f2f38ed54b66442336e64264decede1c8e.tar.gz |
Fix keying of property subpaths.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/animation_track_editor.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index d277ba2f6d..0a1ab8cc49 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -4140,7 +4140,18 @@ void AnimationTrackEditor::insert_node_value_key(Node *p_node, const String &p_p // Let's build a node path. String path = root->get_path_to(p_node, true); - Variant value = p_node->get(p_property); + // Get the value from the subpath. + Variant value = p_node; + Vector<String> property_path = p_property.split(":"); + for (const String &E : property_path) { + if (value.get_type() == Variant::OBJECT) { + Object *obj = value; + value = obj->get(E); + } else { + value = Variant(); + break; + } + } if (Object::cast_to<AnimationPlayer>(p_node) && p_property == "current_animation") { if (p_node == AnimationPlayerEditor::get_singleton()->get_player()) { |