[Bf-blender-cvs] [3e90379] master: View3D: Rotate around selected support for view-roll

Campbell Barton noreply at git.blender.org
Tue Dec 22 19:30:04 CET 2015


Commit: 3e903794f4c93fc2fd821ea4e22c1c083346d0f1
Author: Campbell Barton
Date:   Wed Dec 23 05:20:39 2015 +1100
Branches: master
https://developer.blender.org/rB3e903794f4c93fc2fd821ea4e22c1c083346d0f1

View3D: Rotate around selected support for view-roll

===================================================================

M	source/blender/editors/space_view3d/view3d_edit.c

===================================================================

diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 84ab52f..606f32e 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;




More information about the Bf-blender-cvs mailing list