Skip to content

Commit 77e803f

Browse files
committed
Fix keying of property subpaths.
1 parent 506d6e4 commit 77e803f

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
@@ -4140,7 +4140,18 @@ void AnimationTrackEditor::insert_node_value_key(Node *p_node, const String &p_p
41404140
// Let's build a node path.
41414141
String path = root->get_path_to(p_node, true);
41424142

4143-
Variant value = p_node->get(p_property);
4143+
// Get the value from the subpath.
4144+
Variant value = p_node;
4145+
Vector<String> property_path = p_property.split(":");
4146+
for (const String &E : property_path) {
4147+
if (value.get_type() == Variant::OBJECT) {
4148+
Object *obj = value;
4149+
value = obj->get(E);
4150+
} else {
4151+
value = Variant();
4152+
break;
4153+
}
4154+
}
41444155

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

0 commit comments

Comments
 (0)