Merge pull request #34614 from qarmin/dont_create_preview_of_empty_scene

Don't create preview of empty scene.
This commit is contained in:
Rémi Verschelde 2019-12-30 17:13:07 +01:00 committed by GitHub
commit 388318ad4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1059,10 +1059,13 @@ void EditorNode::_find_node_types(Node *p_node, int &count_2d, int &count_3d) {
void EditorNode::_save_scene_with_preview(String p_file, int p_idx) {
EditorProgress save("save", TTR("Saving Scene"), 4);
if (editor_data.get_edited_scene_root() != NULL) {
save.step(TTR("Analyzing"), 0);
int c2d = 0;
int c3d = 0;
_find_node_types(editor_data.get_edited_scene_root(), c2d, c3d);
bool is2d;
@ -1125,6 +1128,7 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) {
post_process_preview(img);
img->save_png(file);
}
}
save.step(TTR("Saving Scene"), 4);
_save_scene(p_file, p_idx);