diff options
Diffstat (limited to 'editor/import')
-rw-r--r-- | editor/import/scene_import_settings.cpp | 6 | ||||
-rw-r--r-- | editor/import/scene_import_settings.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/editor/import/scene_import_settings.cpp b/editor/import/scene_import_settings.cpp index 1ff771bcce..730aa3bd61 100644 --- a/editor/import/scene_import_settings.cpp +++ b/editor/import/scene_import_settings.cpp @@ -30,6 +30,7 @@ #include "scene_import_settings.h" +#include "core/config/project_settings.h" #include "editor/editor_file_dialog.h" #include "editor/editor_file_system.h" #include "editor/editor_inspector.h" @@ -1288,6 +1289,11 @@ SceneImportSettings::SceneImportSettings() { base_viewport->add_child(camera); camera->make_current(); + if (GLOBAL_GET("rendering/lights_and_shadows/use_physical_light_units")) { + camera_attributes.instantiate(); + camera->set_attributes(camera_attributes); + } + light = memnew(DirectionalLight3D); light->set_transform(Transform3D().looking_at(Vector3(-1, -2, -0.6), Vector3(0, 1, 0))); base_viewport->add_child(light); diff --git a/editor/import/scene_import_settings.h b/editor/import/scene_import_settings.h index b5cf82f64b..104a7a9f7e 100644 --- a/editor/import/scene_import_settings.h +++ b/editor/import/scene_import_settings.h @@ -74,6 +74,7 @@ class SceneImportSettings : public ConfirmationDialog { SubViewport *base_viewport = nullptr; Camera3D *camera = nullptr; + Ref<CameraAttributesPractical> camera_attributes; bool first_aabb = false; AABB contents_aabb; |