Merge pull request #42878 from gvaneyck/copy-description-node-replace
Keep 'Editor Description' metadata when changing a Node's type
This commit is contained in:
commit
fb8d7f9a84
@ -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<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<Node3D>(newnode)) {
|
||||
if (metadata.has("_edit_group_") && metadata["_edit_group_"]) {
|
||||
newnode->set_meta("_edit_group_", true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user