[Bf-blender-cvs] [01645cc] master: NDOF: Auto-Depth preference was used while orbiting

Campbell Barton noreply at git.blender.org
Mon Feb 24 02:57:08 CET 2014


Commit: 01645ccdc6e8de7e5bc851aee0ca3d4831ccedaf
Author: Campbell Barton
Date:   Mon Feb 24 12:53:31 2014 +1100
https://developer.blender.org/rB01645ccdc6e8de7e5bc851aee0ca3d4831ccedaf

NDOF: Auto-Depth preference was used while orbiting

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

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 05af1e2..aa10db9 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -524,7 +524,9 @@ static void viewops_data_alloc(bContext *C, wmOperator *op)
 /**
  * Calculate the values for #ViewOpsData
  */
-static void viewops_data_create(bContext *C, wmOperator *op, const wmEvent *event)
+static void viewops_data_create_ex(bContext *C, wmOperator *op, const wmEvent *event,
+                                   const bool use_orbit_select,
+                                   const bool use_orbit_zbuf)
 {
 	ViewOpsData *vod = op->customdata;
 	static float lastofs[3] = {0, 0, 0};
@@ -541,7 +543,7 @@ static void viewops_data_create(bContext *C, wmOperator *op, const wmEvent *even
 	vod->origx = vod->oldx = event->x;
 	vod->origy = vod->oldy = event->y;
 	vod->origkey = event->type; /* the key that triggered the operator.  */
-	vod->use_dyn_ofs = (U.uiflag & USER_ORBIT_SELECTION) != 0;
+	vod->use_dyn_ofs = use_orbit_select;
 	copy_v3_v3(vod->ofs, rv3d->ofs);
 
 	if (vod->use_dyn_ofs) {
@@ -569,7 +571,7 @@ static void viewops_data_create(bContext *C, wmOperator *op, const wmEvent *even
 
 		negate_v3_v3(vod->dyn_ofs, lastofs);
 	}
-	else if (U.uiflag & USER_ZBUF_ORBIT) {
+	else if (use_orbit_zbuf) {
 		Scene *scene = CTX_data_scene(C);
 		float fallback_depth_pt[3];
 
@@ -648,6 +650,14 @@ static void viewops_data_create(bContext *C, wmOperator *op, const wmEvent *even
 	rv3d->rflag |= RV3D_NAVIGATING;
 }
 
+static void viewops_data_create(bContext *C, wmOperator *op, const wmEvent *event)
+{
+	viewops_data_create_ex(
+	        C, op, event,
+	        (U.uiflag & USER_ORBIT_SELECTION) != 0,
+	        (U.uiflag & USER_ZBUF_ORBIT) != 0);
+}
+
 static void viewops_data_free(bContext *C, wmOperator *op)
 {
 	ARegion *ar;
@@ -1449,7 +1459,8 @@ static int ndof_orbit_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 		const wmNDOFMotionData *ndof = event->customdata;
 
 		viewops_data_alloc(C, op);
-		viewops_data_create(C, op, event);
+		viewops_data_create_ex(C, op, event,
+		                       (U.uiflag & USER_ORBIT_SELECTION) != 0, false);
 
 		vod = op->customdata;
 		v3d = vod->v3d;
@@ -1514,7 +1525,8 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *ev
 		const wmNDOFMotionData *ndof = event->customdata;
 
 		viewops_data_alloc(C, op);
-		viewops_data_create(C, op, event);
+		viewops_data_create_ex(C, op, event,
+		                       (U.uiflag & USER_ORBIT_SELECTION) != 0, false);
 
 		vod = op->customdata;
 		v3d = vod->v3d;
@@ -1669,7 +1681,7 @@ static int ndof_all_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 		
 		const wmNDOFMotionData *ndof = event->customdata;
 
-		viewops_data_alloc(C, op);
+		viewops_data_create_ex(C, op, event, (U.uiflag & USER_ORBIT_SELECTION) != 0, false);
 		viewops_data_create(C, op, event);
 
 		vod = op->customdata;




More information about the Bf-blender-cvs mailing list