diff options
Diffstat (limited to 'source/blender/editors')
5 files changed, 10 insertions, 14 deletions
diff --git a/source/blender/editors/space_view3d/view3d_camera_control.c b/source/blender/editors/space_view3d/view3d_camera_control.c index 1d5b33e7b90..bce0e49d60a 100644 --- a/source/blender/editors/space_view3d/view3d_camera_control.c +++ b/source/blender/editors/space_view3d/view3d_camera_control.c @@ -127,8 +127,7 @@ Object *ED_view3d_cameracontrol_object_get(View3DCameraControl *vctrl) struct View3DCameraControl *ED_view3d_cameracontrol_acquire(Depsgraph *depsgraph, Scene *scene, View3D *v3d, - RegionView3D *rv3d, - const bool use_parent_root) + RegionView3D *rv3d) { View3DCameraControl *vctrl; @@ -139,7 +138,7 @@ struct View3DCameraControl *ED_view3d_cameracontrol_acquire(Depsgraph *depsgraph vctrl->ctx_v3d = v3d; vctrl->ctx_rv3d = rv3d; - vctrl->use_parent_root = use_parent_root; + vctrl->use_parent_root = v3d->camera->transflag & OB_TRANSFORM_ADJUST_ROOT_PARENT_FOR_VIEW_LOCK; vctrl->persp_backup = rv3d->persp; vctrl->dist_backup = rv3d->dist; @@ -153,7 +152,7 @@ struct View3DCameraControl *ED_view3d_cameracontrol_acquire(Depsgraph *depsgraph if (rv3d->persp == RV3D_CAMOB) { Object *ob_back; - if (use_parent_root && (vctrl->root_parent = v3d->camera->parent)) { + if (vctrl->use_parent_root && (vctrl->root_parent = v3d->camera->parent)) { while (vctrl->root_parent->parent) { vctrl->root_parent = vctrl->root_parent->parent; } diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index 6ce76c478df..6824c526888 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -392,7 +392,7 @@ static bool initFlyInfo(bContext *C, FlyInfo *fly, wmOperator *op, const wmEvent } fly->v3d_camera_control = ED_view3d_cameracontrol_acquire( - fly->depsgraph, fly->scene, fly->v3d, fly->rv3d, (U.uiflag & USER_CAM_LOCK_NO_PARENT) == 0); + fly->depsgraph, fly->scene, fly->v3d, fly->rv3d); /* calculate center */ if (ED_view3d_cameracontrol_object_get(fly->v3d_camera_control)) { diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index b23b9db3211..0815850d694 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -228,8 +228,7 @@ void view3d_buttons_register(struct ARegionType *art); struct View3DCameraControl *ED_view3d_cameracontrol_acquire(struct Depsgraph *depsgraph, Scene *scene, View3D *v3d, - RegionView3D *rv3d, - const bool use_parent_root); + RegionView3D *rv3d); void ED_view3d_cameracontrol_update(struct View3DCameraControl *vctrl, const bool use_autokey, struct bContext *C, diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c index 631994c9b85..3f7d6142758 100644 --- a/source/blender/editors/space_view3d/view3d_utils.c +++ b/source/blender/editors/space_view3d/view3d_utils.c @@ -552,7 +552,8 @@ bool ED_view3d_camera_lock_sync(const Depsgraph *depsgraph, View3D *v3d, RegionV ObjectTfmProtectedChannels obtfm; Object *root_parent; - if ((U.uiflag & USER_CAM_LOCK_NO_PARENT) == 0 && (root_parent = v3d->camera->parent)) { + if (v3d->camera->transflag & OB_TRANSFORM_ADJUST_ROOT_PARENT_FOR_VIEW_LOCK && + (root_parent = v3d->camera->parent)) { Object *ob_update; float tmat[4][4]; float imat[4][4]; @@ -655,7 +656,8 @@ bool ED_view3d_camera_lock_autokey(View3D *v3d, Scene *scene = CTX_data_scene(C); ID *id_key; Object *root_parent; - if ((U.uiflag & USER_CAM_LOCK_NO_PARENT) == 0 && (root_parent = v3d->camera->parent)) { + if (v3d->camera->transflag & OB_TRANSFORM_ADJUST_ROOT_PARENT_FOR_VIEW_LOCK && + (root_parent = v3d->camera->parent)) { while (root_parent->parent) { root_parent = root_parent->parent; } diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c index 3c9e4fa49b9..7de28096607 100644 --- a/source/blender/editors/space_view3d/view3d_walk.c +++ b/source/blender/editors/space_view3d/view3d_walk.c @@ -585,11 +585,7 @@ static bool initWalkInfo(bContext *C, WalkInfo *walk, wmOperator *op) walk->scene, 0, walk->region, walk->v3d); walk->v3d_camera_control = ED_view3d_cameracontrol_acquire( - walk->depsgraph, - walk->scene, - walk->v3d, - walk->rv3d, - (U.uiflag & USER_CAM_LOCK_NO_PARENT) == 0); + walk->depsgraph, walk->scene, walk->v3d, walk->rv3d); /* center the mouse */ walk->center_mval[0] = walk->region->winx * 0.5f; |