diff options
author | Jeroen Bakker <jeroen@blender.org> | 2022-11-11 16:09:19 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-11-11 16:09:19 +0300 |
commit | 3da57487873dcac70e29b4f4b82d93889477fed9 (patch) | |
tree | be3ec30dc0311fd176479a0e7df0e5415174fb4a /source/blender/editors | |
parent | ca134581a2a312ebb27f8f79ffb3cc757421a816 (diff) |
Fix corrupt rv3d.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.cc b/source/blender/editors/space_view3d/view3d_draw.cc index 2da8e86b043..468de37a9a2 100644 --- a/source/blender/editors/space_view3d/view3d_draw.cc +++ b/source/blender/editors/space_view3d/view3d_draw.cc @@ -1551,11 +1551,13 @@ static void view3d_virtual_camera_update(const bContext *C, ARegion *region, Obj View3D *v3d = CTX_wm_view3d(C); int2 resolution(1920 / 2, 1080 / 2); - RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata); - int old_persp = rv3d->persp; + RegionView3D *old_rv3d = static_cast<RegionView3D *>(region->regiondata); + RegionView3D rv3d = {*old_rv3d}; + region->regiondata = &rv3d; + Object *old_camera = v3d->camera; v3d->camera = object; - rv3d->persp = RV3D_CAMOB; + rv3d.persp = RV3D_CAMOB; Camera *camera = static_cast<Camera *>(object->data); if (camera->runtime.virtual_display_texture == nullptr) { @@ -1599,7 +1601,7 @@ static void view3d_virtual_camera_update(const bContext *C, ARegion *region, Obj camera->runtime.virtual_display_texture); v3d->camera = old_camera; - rv3d->persp = old_persp; + region->regiondata = old_rv3d; } static void view3d_draw_virtual_camera(const bContext *C, ARegion *region) |