mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 04:05:04 +00:00
Merge pull request #92678 from warriormaster12/dup_prop_before_remap_resources
Duplicate properties first before remapping resources
This commit is contained in:
commit
0ec023f101
@ -2777,12 +2777,12 @@ Node *Node::duplicate(int p_flags) const {
|
||||
ERR_THREAD_GUARD_V(nullptr);
|
||||
Node *dupe = _duplicate(p_flags);
|
||||
|
||||
_duplicate_properties(this, this, dupe, p_flags);
|
||||
|
||||
if (dupe && (p_flags & DUPLICATE_SIGNALS)) {
|
||||
_duplicate_signals(this, dupe);
|
||||
}
|
||||
|
||||
_duplicate_properties(this, this, dupe, p_flags);
|
||||
|
||||
return dupe;
|
||||
}
|
||||
|
||||
@ -2795,6 +2795,8 @@ Node *Node::duplicate_from_editor(HashMap<const Node *, Node *> &r_duplimap, con
|
||||
int flags = DUPLICATE_SIGNALS | DUPLICATE_GROUPS | DUPLICATE_SCRIPTS | DUPLICATE_USE_INSTANTIATION | DUPLICATE_FROM_EDITOR;
|
||||
Node *dupe = _duplicate(flags, &r_duplimap);
|
||||
|
||||
_duplicate_properties(this, this, dupe, flags);
|
||||
|
||||
// This is used by SceneTreeDock's paste functionality. When pasting to foreign scene, resources are duplicated.
|
||||
if (!p_resource_remap.is_empty()) {
|
||||
remap_node_resources(dupe, p_resource_remap);
|
||||
@ -2805,8 +2807,6 @@ Node *Node::duplicate_from_editor(HashMap<const Node *, Node *> &r_duplimap, con
|
||||
// if the emitter node comes later in tree order than the receiver
|
||||
_duplicate_signals(this, dupe);
|
||||
|
||||
_duplicate_properties(this, this, dupe, flags);
|
||||
|
||||
return dupe;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user