From b3c08a3a0a9b0cd9e66bbf4bdeeedb6c2c5e7c76 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Fri, 14 Aug 2020 16:57:57 +0200 Subject: Fix constant lighting change in VR view when rotating head We have to explicitly enable fixed world space lighting. This was in fact already done, but overridden by the code to sync the 3D View shading settings to the VR view. --- source/blender/blenloader/intern/versioning_280.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 111ac728cc3..51df61143e0 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -4951,8 +4951,6 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) const View3D *v3d_default = DNA_struct_default_get(View3D); 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; @@ -5110,6 +5108,12 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + for (wmWindowManager *wm = bmain->wm.first; wm; wm = wm->id.next) { + /* Don't rotate light with the viewer by default, make it fixed. Shading settings can't be + * edited and this flag should always be set. So we can always execute this. */ + wm->xr.session_settings.shading.flag |= V3D_SHADING_WORLD_ORIENTATION; + } + /* Keep this block, even when empty. */ } } -- cgit v1.2.3