Skip to content

Commit 168e605

Browse files
committed
Merge pull request godotengine#97563 from SaracenOne/key_sub_paths
Fix keying of property subpaths.
2 parents e857e81 + 77e803f commit 168e605

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

editor/animation_track_editor.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4279,7 +4279,18 @@ void AnimationTrackEditor::insert_node_value_key(Node *p_node, const String &p_p
42794279
// Let's build a node path.
42804280
String path = root->get_path_to(p_node, true);
42814281

4282-
Variant value = p_node->get(p_property);
4282+
// Get the value from the subpath.
4283+
Variant value = p_node;
4284+
Vector<String> property_path = p_property.split(":");
4285+
for (const String &E : property_path) {
4286+
if (value.get_type() == Variant::OBJECT) {
4287+
Object *obj = value;
4288+
value = obj->get(E);
4289+
} else {
4290+
value = Variant();
4291+
break;
4292+
}
4293+
}
42834294

42844295
if (Object::cast_to<AnimationPlayer>(p_node) && p_property == "current_animation") {
42854296
if (p_node == AnimationPlayerEditor::get_singleton()->get_player()) {

0 commit comments

Comments
 (0)