Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-08-09 03:51:03 +0300
committerCampbell Barton <campbell@blender.org>2022-08-09 03:51:03 +0300
commit35b0a2f5e790eaf50e0487f58fa57f8e23f607ea (patch)
treee316c3182f4b953d71990e3f81a4f28085568d23 /source/blender/editors
parent4915fc4547e050da19bc5af525a0ea1cc8f49f2a (diff)
parent228f7cb5cec86d45757ae350d816e5e7c7c9123a (diff)
Merge branch 'blender-v3.3-release'
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_view3d/view3d_navigate.c7
-rw-r--r--source/blender/editors/space_view3d/view3d_navigate_roll.c10
-rw-r--r--source/blender/editors/space_view3d/view3d_navigate_zoom_border.c10
3 files changed, 22 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_navigate.c b/source/blender/editors/space_view3d/view3d_navigate.c
index 5b3a7483ac1..f50e933fdac 100644
--- a/source/blender/editors/space_view3d/view3d_navigate.c
+++ b/source/blender/editors/space_view3d/view3d_navigate.c
@@ -1451,7 +1451,12 @@ static int vieworbit_exec(bContext *C, wmOperator *op)
ED_view3d_smooth_view_force_finish(C, v3d, region);
if ((RV3D_LOCK_FLAGS(rv3d) & RV3D_LOCK_ROTATION) == 0 || (view_opposite != RV3D_VIEW_USER)) {
- if ((rv3d->persp != RV3D_CAMOB) || ED_view3d_camera_lock_check(v3d, rv3d)) {
+ const bool is_camera_lock = ED_view3d_camera_lock_check(v3d, rv3d);
+ if ((rv3d->persp != RV3D_CAMOB) || is_camera_lock) {
+ if (is_camera_lock) {
+ const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
+ ED_view3d_camera_lock_init(depsgraph, v3d, rv3d);
+ }
int smooth_viewtx = WM_operator_smooth_viewtx_get(op);
float quat_mul[4];
float quat_new[4];
diff --git a/source/blender/editors/space_view3d/view3d_navigate_roll.c b/source/blender/editors/space_view3d/view3d_navigate_roll.c
index 3c15fdf3b64..af93aa50238 100644
--- a/source/blender/editors/space_view3d/view3d_navigate_roll.c
+++ b/source/blender/editors/space_view3d/view3d_navigate_roll.c
@@ -15,6 +15,8 @@
#include "RNA_access.h"
#include "RNA_define.h"
+#include "DEG_depsgraph_query.h"
+
#include "ED_screen.h"
#include "view3d_intern.h"
@@ -167,7 +169,13 @@ static int viewroll_exec(bContext *C, wmOperator *op)
}
rv3d = region->regiondata;
- if ((rv3d->persp != RV3D_CAMOB) || ED_view3d_camera_lock_check(v3d, rv3d)) {
+
+ const bool is_camera_lock = ED_view3d_camera_lock_check(v3d, rv3d);
+ if ((rv3d->persp != RV3D_CAMOB) || is_camera_lock) {
+ if (is_camera_lock) {
+ const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
+ ED_view3d_camera_lock_init(depsgraph, v3d, rv3d);
+ }
ED_view3d_smooth_view_force_finish(C, v3d, region);
diff --git a/source/blender/editors/space_view3d/view3d_navigate_zoom_border.c b/source/blender/editors/space_view3d/view3d_navigate_zoom_border.c
index eaabee9e891..7cafc3dfd42 100644
--- a/source/blender/editors/space_view3d/view3d_navigate_zoom_border.c
+++ b/source/blender/editors/space_view3d/view3d_navigate_zoom_border.c
@@ -159,11 +159,15 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
/* clamp after because we may have been zooming out */
CLAMP(new_dist, dist_range[0], dist_range[1]);
- /* TODO(campbell): 'is_camera_lock' not currently working well. */
const bool is_camera_lock = ED_view3d_camera_lock_check(v3d, rv3d);
- if ((rv3d->persp == RV3D_CAMOB) && (is_camera_lock == false)) {
+ if (rv3d->persp == RV3D_CAMOB) {
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
- ED_view3d_persp_switch_from_camera(depsgraph, v3d, rv3d, RV3D_PERSP);
+ if (is_camera_lock) {
+ ED_view3d_camera_lock_init(depsgraph, v3d, rv3d);
+ }
+ else {
+ ED_view3d_persp_switch_from_camera(depsgraph, v3d, rv3d, RV3D_PERSP);
+ }
}
ED_view3d_smooth_view(C,