mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Fix crash when reimporting nested gltf scenes
(cherry picked from commit efc3e3aea7
)
This commit is contained in:
parent
c477d248c6
commit
abef5e0d23
1 changed files with 12 additions and 0 deletions
|
@ -6369,6 +6369,18 @@ void EditorNode::reload_instances_with_path_in_edited_scenes() {
|
|||
|
||||
get_scene_editor_data_for_node(owner, original_node, scene_editor_data_table);
|
||||
|
||||
// The current node being reloaded may also be an additional node for another node
|
||||
// that is in the process of being reloaded.
|
||||
// Replacing the additional node with the new one prevents a crash where nodes
|
||||
// in 'addition_list' are removed from the scene tree and queued for deletion.
|
||||
for (InstanceModificationsEntry &im : scene_modifications->instance_list) {
|
||||
for (AdditiveNodeEntry &additive_node_entry : im.addition_list) {
|
||||
if (additive_node_entry.node == original_node) {
|
||||
additive_node_entry.node = instantiated_node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool original_node_scene_instance_load_placeholder = original_node->get_scene_instance_load_placeholder();
|
||||
|
||||
// Delete all the remaining node children.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue