diff options
author | Julian Eisel <julian@blender.org> | 2020-08-14 17:57:57 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-08-14 18:03:10 +0300 |
commit | b3c08a3a0a9b0cd9e66bbf4bdeeedb6c2c5e7c76 (patch) | |
tree | 973646ddefd56daeb38e21c19a1b7a8358dc7c18 /source/blender/editors/space_view3d/view3d_view.c | |
parent | c074943dfd914fafd25f59cd43e26b4e8ac499f0 (diff) |
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.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_view.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 66efa5b5de3..839f8c60a66 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1733,6 +1733,8 @@ void ED_view3d_xr_shading_update(wmWindowManager *wm, const View3D *v3d, const S { if (v3d->runtime.flag & V3D_RUNTIME_XR_SESSION_ROOT) { View3DShading *xr_shading = &wm->xr.session_settings.shading; + /* Flags that shouldn't be overridden by the 3D View shading. */ + const int flag_copy = V3D_SHADING_WORLD_ORIENTATION; BLI_assert(WM_xr_session_exists(&wm->xr)); @@ -1750,7 +1752,9 @@ void ED_view3d_xr_shading_update(wmWindowManager *wm, const View3D *v3d, const S } /* Copy shading from View3D to VR view. */ + const int old_xr_shading_flag = xr_shading->flag; *xr_shading = v3d->shading; + xr_shading->flag = (xr_shading->flag & ~flag_copy) | (old_xr_shading_flag & flag_copy); if (v3d->shading.prop) { xr_shading->prop = IDP_CopyProperty(xr_shading->prop); } |