diff options
author | Thaddeus Crews <repiteo@outlook.com> | 2024-10-10 18:13:21 -0500 |
---|---|---|
committer | Thaddeus Crews <repiteo@outlook.com> | 2024-10-10 18:13:21 -0500 |
commit | 168e605ad7c4aca77241ee28eab0142a6e9ac6c7 (patch) | |
tree | cbec30864c12ef078fab5fb144dbdaedc57b27d1 | |
parent | e857e81cf7c2e0de06786e3bf172151e80fe59ce (diff) | |
parent | 77e803f2f38ed54b66442336e64264decede1c8e (diff) | |
download | redot-engine-168e605ad7c4aca77241ee28eab0142a6e9ac6c7.tar.gz |
Merge pull request #97563 from SaracenOne/key_sub_paths
Fix keying of property subpaths.
-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 c02efc445f..f8d35f2112 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -4279,7 +4279,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()) { |