Merge pull request #47172 from CaptainProton42/fix-3d-scene-preview

Fix 3D scene preview generation.
This commit is contained in:
Rémi Verschelde 2021-05-04 17:56:44 +02:00 committed by GitHub
commit 4dacd22dcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1408,8 +1408,9 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) {
} else { } else {
// The 3D editor may be disabled as a feature, but scenes can still be opened. // The 3D editor may be disabled as a feature, but scenes can still be opened.
// This check prevents the preview from regenerating in case those scenes are then saved. // This check prevents the preview from regenerating in case those scenes are then saved.
// The preview will be generated if no feature profile is set (as the 3D editor is enabled by default).
Ref<EditorFeatureProfile> profile = feature_profile_manager->get_current_profile(); Ref<EditorFeatureProfile> profile = feature_profile_manager->get_current_profile();
if (profile.is_valid() && !profile->is_feature_disabled(EditorFeatureProfile::FEATURE_3D)) { if (!profile.is_valid() || !profile->is_feature_disabled(EditorFeatureProfile::FEATURE_3D)) {
img = Node3DEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_texture()->get_image(); img = Node3DEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_texture()->get_image();
} }
} }