[Bf-blender-cvs] [fb8ff0c112f] vr_scene_inspection: Enable fixed world space lighting by default
Julian Eisel
noreply at git.blender.org
Mon Mar 16 14:11:04 CET 2020
Commit: fb8ff0c112fecf1d7b336ea64b6971a20a83a1f5
Author: Julian Eisel
Date: Mon Mar 16 14:09:37 2020 +0100
Branches: vr_scene_inspection
https://developer.blender.org/rBfb8ff0c112fecf1d7b336ea64b6971a20a83a1f5
Enable fixed world space lighting by default
Also make the button for it optional in the UI (the VR Add-on will hide
it for now).
===================================================================
M release/scripts/startup/bl_ui/utils.py
M source/blender/blenloader/intern/versioning_280.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/utils.py b/release/scripts/startup/bl_ui/utils.py
index d5d74a5958e..f9fb2f9bf0d 100644
--- a/release/scripts/startup/bl_ui/utils.py
+++ b/release/scripts/startup/bl_ui/utils.py
@@ -73,7 +73,7 @@ class View3DShadingLightingLayout:
return shading.type in {'SOLID', 'MATERIAL'} or engine == 'BLENDER_EEVEE' and shading.type == 'RENDERED'
@staticmethod
- def draw(context, shading, layout):
+ def draw(context, shading, layout, add_world_space_lighting_prop=True):
col = layout.column()
split = col.split(factor=0.9)
@@ -110,8 +110,9 @@ class View3DShadingLightingLayout:
col = split.column()
row = col.row()
- row.prop(shading, "use_world_space_lighting",
- text="", icon='WORLD', toggle=True)
+ if add_world_space_lighting_prop:
+ row.prop(shading, "use_world_space_lighting",
+ text="", icon='WORLD', toggle=True)
row = row.row()
row.active = shading.use_world_space_lighting
row.prop(shading, "studiolight_rotate_z", text="Rotation")
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 2c0ebc978e4..c6e51b452c4 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -4855,7 +4855,9 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (wmWindowManager *wm = bmain->wm.first; wm; wm = wm->id.next) {
const View3D *v3d_default = DNA_struct_default_get(View3D);
- BKE_screen_view3d_shading_init(&wm->xr.session_settings.shading);
+ wm->xr.session_settings.shading = v3d_default->shading;
+ /* Don't rotate light with the viewer by default, make it fixed. */
+ wm->xr.session_settings.shading.flag |= V3D_SHADING_WORLD_ORIENTATION;
wm->xr.session_settings.draw_flags = (V3D_OFSDRAW_SHOW_GRIDFLOOR |
V3D_OFSDRAW_SHOW_ANNOTATION);
wm->xr.session_settings.clip_start = v3d_default->clip_start;
More information about the Bf-blender-cvs
mailing list