summaryrefslogtreecommitdiff
path: root/editor/editor_properties.cpp
diff options
context:
space:
mode:
authorvolzhs <volzhs@gmail.com>2018-06-22 14:48:49 +0900
committervolzhs <volzhs@gmail.com>2018-06-22 14:48:49 +0900
commitb4f60ae3acaddfcc3cae02c7f9e804b1909a8f02 (patch)
tree0bec8e102c8a6e73507e934d475a87120a58693e /editor/editor_properties.cpp
parentb76143bfdee9ff0c21e1aac247567d2381dffa4d (diff)
Fix crash when assigning a node on editing animation key
Diffstat (limited to 'editor/editor_properties.cpp')
-rw-r--r--editor/editor_properties.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 5abcae80e0..d3da257fde 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -1522,8 +1522,15 @@ EditorPropertyColor::EditorPropertyColor() {
void EditorPropertyNodePath::_node_selected(const NodePath &p_path) {
+ NodePath path = p_path;
Node *base_node = Object::cast_to<Node>(get_edited_object());
- emit_signal("property_changed", get_edited_property(), base_node->get_path().rel_path_to(p_path));
+ if (base_node == NULL && get_edited_object()->has_method("get_root_path")) {
+ base_node = get_edited_object()->call("get_root_path");
+ }
+ if (base_node) { // for AnimationTrackKeyEdit
+ path = base_node->get_path().rel_path_to(p_path);
+ }
+ emit_signal("property_changed", get_edited_property(), path);
update_property();
}