From 8e8398209e025d80a9981c0dbf8362a9ad1e600b Mon Sep 17 00:00:00 2001 From: kobewi Date: Mon, 7 Jun 2021 12:52:05 +0200 Subject: [PATCH] Don't remap resources belonging to instance --- editor/scene_tree_dock.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 349e05b47b0..8d6b7f33897 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -2959,6 +2959,7 @@ void SceneTreeDock::_clear_clipboard() { void SceneTreeDock::_create_remap_for_node(Node *p_node, Map &r_remap) { List props; p_node->get_property_list(&props); + bool is_instanced = EditorPropertyRevert::may_node_be_in_instance(p_node); for (List::Element *E = props.front(); E; E = E->next()) { if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) { @@ -2969,6 +2970,15 @@ void SceneTreeDock::_create_remap_for_node(Node *p_node, Map &r_remap) if (v.is_ref()) { RES res = v; if (res.is_valid()) { + if (is_instanced) { + Variant orig; + if (EditorPropertyRevert::get_instanced_node_original_property(p_node, E->get().name, orig)) { + if (!EditorPropertyRevert::is_node_property_different(p_node, v, orig)) { + continue; + } + } + } + if ((res->get_path() == "" || res->get_path().find("::") > -1) && !r_remap.has(res)) { _create_remap_for_resource(res, r_remap); }