From a22275c8a29b1ee00f4d2c89da8c452b72c84493 Mon Sep 17 00:00:00 2001 From: Gabriel Van Eyck Date: Sun, 18 Oct 2020 11:22:54 -0700 Subject: [PATCH] Keep 'Editor Description' metadata when changing a Node's type Also copy edit group/lock when replacing a Node3D --- editor/scene_tree_dock.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index fa2270dcd64..c4e90ca3ff9 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -2107,8 +2107,12 @@ void SceneTreeDock::replace_node(Node *p_node, Node *p_by_node, bool p_keep_prop } if (E->get().name == "__meta__") { - if (Object::cast_to(newnode)) { - Dictionary metadata = n->get(E->get().name); + Dictionary metadata = n->get(E->get().name); + if (metadata.has("_editor_description_")) { + newnode->set_meta("_editor_description_", metadata["_editor_description_"]); + } + + if (Object::cast_to(newnode) || Object::cast_to(newnode)) { if (metadata.has("_edit_group_") && metadata["_edit_group_"]) { newnode->set_meta("_edit_group_", true); }