Skip to content

Commit

Permalink
Fix issue with 3D scene drag and drop preview node
Browse files Browse the repository at this point in the history
  • Loading branch information
EelisOtsamo committed Nov 24, 2023
1 parent 1ba920f commit 834ccb9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion editor/plugins/node_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4152,6 +4152,7 @@ Node *Node3DEditorViewport::_sanitize_preview_node(Node *p_node) const {
}

void Node3DEditorViewport::_create_preview_node(const Vector<String> &files) const {
bool add_preview = false;
for (int i = 0; i < files.size(); i++) {
String path = files[i];
Ref<Resource> res = ResourceLoader::load(path);
Expand All @@ -4172,9 +4173,13 @@ void Node3DEditorViewport::_create_preview_node(const Vector<String> &files) con
}
}
}
EditorNode::get_singleton()->get_scene_root()->add_child(preview_node);
add_preview = true;
}
}
if (add_preview) {
EditorNode::get_singleton()->get_scene_root()->add_child(preview_node);
}

*preview_bounds = _calculate_spatial_bounds(preview_node);
}

Expand Down

0 comments on commit 834ccb9

Please sign in to comment.