Explorar o código

fixes #6695 - MultiNodeEdit edit path in exported NodePath

(cherry picked from commit ced8fb480600b9b64e0c82735e592c2103accb3f)
Răzvan Cosmin Rădulescu %!s(int64=9) %!d(string=hai) anos
pai
achega
6775cce469
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      tools/editor/multi_node_edit.cpp

+ 8 - 1
tools/editor/multi_node_edit.cpp

@@ -53,7 +53,14 @@ bool MultiNodeEdit::_set(const StringName& p_name, const Variant& p_value){
 		if (!n)
 			continue;
 
-		ur->add_do_property(n,name,p_value);
+		if (p_value.get_type() == Variant::NODE_PATH) {
+			Node *tonode = n->get_node(p_value);
+			NodePath p_path = n->get_path_to(tonode);
+			ur->add_do_property(n,name,p_path);
+		} else {
+			ur->add_do_property(n,name,p_value);
+		}
+
 		ur->add_undo_property(n,name,n->get(name));