Skip to content

Commit

Permalink
Merge pull request #80149 from aaronfranke/fix-res-reimport-empty-scene
Browse files Browse the repository at this point in the history
Fix error message when reimporting resources with an empty scene open
  • Loading branch information
akien-mga committed Sep 4, 2023
2 parents 92da5a7 + ff911c3 commit a0d21d4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions editor/import_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,11 @@ void ImportDock::_reimport_and_cleanup() {
Ref<Resource> old_res = old_resources[path];
Ref<Resource> new_res = ResourceLoader::load(path);

for (int j = 0; j < EditorNode::get_editor_data().get_edited_scene_count(); j++) {
_replace_resource_in_object(EditorNode::get_editor_data().get_edited_scene_root(j), old_res, new_res);
for (int i = 0; i < EditorNode::get_editor_data().get_edited_scene_count(); i++) {
Node *edited_scene_root = EditorNode::get_editor_data().get_edited_scene_root(i);
if (likely(edited_scene_root)) {
_replace_resource_in_object(edited_scene_root, old_res, new_res);
}
}
for (Ref<Resource> res : external_resources) {
_replace_resource_in_object(res.ptr(), old_res, new_res);
Expand Down

0 comments on commit a0d21d4

Please sign in to comment.