Fix editable children state when duplicating instantiated nodes
Co-Authored-By: Pedro J. Estébanez <RandomShaper@users.noreply.github.com> (cherry picked from commit c0706bb71d1ae85a17e3b25a463ab6c192fe213c)
This commit is contained in:
@@ -2866,6 +2866,19 @@ Node *Node::_duplicate(int p_flags, HashMap<const Node *, Node *> *r_duplimap) c
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (List<const Node *>::Element *N = node_tree.front(); N; N = N->next()) {
|
||||
const Node *source_node = N->get();
|
||||
if (source_node->get_scene_file_path().is_empty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
NodePath relative_path = get_path_to(source_node);
|
||||
Node *duplicated_node = node->get_node_or_null(relative_path);
|
||||
ERR_CONTINUE(!duplicated_node);
|
||||
|
||||
duplicated_node->data.editable_instance = source_node->data.editable_instance;
|
||||
}
|
||||
}
|
||||
|
||||
if (get_name() != String()) {
|
||||
|
||||
Reference in New Issue
Block a user