Keep 'Editor Description' metadata when changing a Node's type
Also copy edit group/lock when replacing a Node3D
(cherry picked from commit a22275c8a2
)
This commit is contained in:
parent
730d42d8a4
commit
5b9c16a324
|
@ -2128,8 +2128,12 @@ void SceneTreeDock::replace_node(Node *p_node, Node *p_by_node, bool p_keep_prop
|
|||
continue;
|
||||
|
||||
if (E->get().name == "__meta__") {
|
||||
if (Object::cast_to<CanvasItem>(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<CanvasItem>(newnode) || Object::cast_to<Spatial>(newnode)) {
|
||||
if (metadata.has("_edit_group_") && metadata["_edit_group_"]) {
|
||||
newnode->set_meta("_edit_group_", true);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue