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 <ideasman42@gmail.com>2015-12-22 21:20:39 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-12-22 21:23:04 +0300
commit3e903794f4c93fc2fd821ea4e22c1c083346d0f1 (patch)
treeced59fe6caaa7611a30dd9bd746b187d8b038c42
parent642b77ef0e394baf090b417f93c094093c885aa6 (diff)
View3D: Rotate around selected support for view-roll
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 84ab52f92a1..606f32ef776 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -4104,6 +4104,10 @@ static void viewroll_apply(ViewOpsData *vod, int x, int UNUSED(y))
if (angle != 0.0f)
view_roll_angle(vod->ar, vod->rv3d->viewquat, vod->oldquat, vod->mousevec, angle);
+ if (vod->use_dyn_ofs) {
+ view3d_orbit_apply_dyn_ofs(vod->rv3d->ofs, vod->ofs, vod->oldquat, vod->rv3d->viewquat, vod->dyn_ofs);
+ }
+
if (vod->rv3d->viewlock & RV3D_BOXVIEW)
view3d_boxview_sync(vod->sa, vod->ar);
@@ -4205,9 +4209,18 @@ static int viewroll_exec(bContext *C, wmOperator *op)
negate_v3(mousevec);
view_roll_angle(ar, quat_new, rv3d->viewquat, mousevec, angle);
+ const float *dyn_ofs_pt = NULL;
+ float dyn_ofs[3];
+ if (U.uiflag & USER_ORBIT_SELECTION) {
+ if (view3d_orbit_calc_center(C, dyn_ofs)) {
+ negate_v3(dyn_ofs);
+ dyn_ofs_pt = dyn_ofs;
+ }
+ }
+
ED_view3d_smooth_view(
C, v3d, ar, smooth_viewtx,
- &(const V3D_SmoothParams){.quat = quat_new});
+ &(const V3D_SmoothParams){.quat = quat_new, .dyn_ofs = dyn_ofs_pt});
viewops_data_free(C, op);
return OPERATOR_FINISHED;