|
@@ -377,10 +377,17 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map
|
|
return OK;
|
|
return OK;
|
|
}
|
|
}
|
|
|
|
|
|
- // save the child instanced scenes that are chosen as editable, so they can be restored
|
|
|
|
|
|
+ bool is_editable_instance = false;
|
|
|
|
+
|
|
|
|
+ // save the child instantiated scenes that are chosen as editable, so they can be restored
|
|
// upon load back
|
|
// upon load back
|
|
if (p_node != p_owner && p_node->get_filename() != String() && p_owner->is_editable_instance(p_node)) {
|
|
if (p_node != p_owner && p_node->get_filename() != String() && p_owner->is_editable_instance(p_node)) {
|
|
editable_instances.push_back(p_owner->get_path_to(p_node));
|
|
editable_instances.push_back(p_owner->get_path_to(p_node));
|
|
|
|
+ // Node is the root of an editable instance.
|
|
|
|
+ is_editable_instance = true;
|
|
|
|
+ } else if (p_node->get_owner() && p_node->get_owner() != p_owner && p_owner->is_editable_instance(p_node->get_owner())) {
|
|
|
|
+ // Node is part of an editable instance.
|
|
|
|
+ is_editable_instance = true;
|
|
}
|
|
}
|
|
|
|
|
|
NodeData nd;
|
|
NodeData nd;
|
|
@@ -610,7 +617,7 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map
|
|
|
|
|
|
// Save the right type. If this node was created by an instance
|
|
// Save the right type. If this node was created by an instance
|
|
// then flag that the node should not be created but reused
|
|
// then flag that the node should not be created but reused
|
|
- if (pack_state_stack.empty()) {
|
|
|
|
|
|
+ if (pack_state_stack.empty() && !is_editable_instance) {
|
|
//this node is not part of an instancing process, so save the type
|
|
//this node is not part of an instancing process, so save the type
|
|
nd.type = _nm_get_string(p_node->get_class(), name_map);
|
|
nd.type = _nm_get_string(p_node->get_class(), name_map);
|
|
} else {
|
|
} else {
|