[Bf-blender-cvs] [9e56c57] master: Cleanup: use more logical names for View3D.around

Campbell Barton noreply at git.blender.org
Tue Dec 1 09:02:12 CET 2015


Commit: 9e56c570c3fbca4bae9a1da24828b6e640299f99
Author: Campbell Barton
Date:   Tue Dec 1 18:52:24 2015 +1100
Branches: master
https://developer.blender.org/rB9e56c570c3fbca4bae9a1da24828b6e640299f99

Cleanup: use more logical names for View3D.around

D1651 (own patch)

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

M	source/blender/blenloader/intern/versioning_260.c
M	source/blender/editors/armature/armature_edit.c
M	source/blender/editors/mesh/editmesh_bevel.c
M	source/blender/editors/mesh/editmesh_inset.c
M	source/blender/editors/object/object_transform.c
M	source/blender/editors/space_clip/clip_ops.c
M	source/blender/editors/space_clip/space_clip.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/editors/space_view3d/view3d_edit.c
M	source/blender/editors/space_view3d/view3d_snap.c
M	source/blender/editors/transform/transform.c
M	source/blender/editors/transform/transform_conversions.c
M	source/blender/editors/transform/transform_generics.c
M	source/blender/editors/transform/transform_manipulator.c
M	source/blender/editors/transform/transform_orientations.c
M	source/blender/editors/uvedit/uvedit_ops.c
M	source/blender/editors/uvedit/uvedit_unwrap_ops.c
M	source/blender/makesdna/DNA_view3d_types.h
M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c
index 9456c28..77a4aef 100644
--- a/source/blender/blenloader/intern/versioning_260.c
+++ b/source/blender/blenloader/intern/versioning_260.c
@@ -1386,7 +1386,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
 							SpaceClip *sclip = (SpaceClip *)sl;
 
 							if (sclip->around == 0) {
-								sclip->around = V3D_CENTROID;
+								sclip->around = V3D_AROUND_CENTER_MEAN;
 							}
 						}
 					}
diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c
index 5a0e70d..94b7277 100644
--- a/source/blender/editors/armature/armature_edit.c
+++ b/source/blender/editors/armature/armature_edit.c
@@ -156,7 +156,7 @@ void ED_armature_origin_set(Scene *scene, Object *ob, float cursor[3], int cente
 		mul_m4_v3(ob->imat, cent);
 	}
 	else {
-		if (around == V3D_CENTROID) {
+		if (around == V3D_AROUND_CENTER_MEAN) {
 			int total = 0;
 			zero_v3(cent);
 			for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c
index ce68563..f001ead 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -259,7 +259,7 @@ static int edbm_bevel_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 	opdata = op->customdata;
 
 	/* initialize mouse values */
-	if (!calculateTransformCenter(C, V3D_CENTROID, center_3d, opdata->mcenter)) {
+	if (!calculateTransformCenter(C, V3D_AROUND_CENTER_MEAN, center_3d, opdata->mcenter)) {
 		/* in this case the tool will likely do nothing,
 		 * ideally this will never happen and should be checked for above */
 		opdata->mcenter[0] = opdata->mcenter[1] = 0;
diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c
index 14a477e..937547c 100644
--- a/source/blender/editors/mesh/editmesh_inset.c
+++ b/source/blender/editors/mesh/editmesh_inset.c
@@ -280,7 +280,7 @@ static int edbm_inset_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 	opdata = op->customdata;
 
 	/* initialize mouse values */
-	if (!calculateTransformCenter(C, V3D_CENTROID, center_3d, opdata->mcenter)) {
+	if (!calculateTransformCenter(C, V3D_AROUND_CENTER_MEAN, center_3d, opdata->mcenter)) {
 		/* in this case the tool will likely do nothing,
 		 * ideally this will never happen and should be checked for above */
 		opdata->mcenter[0] = opdata->mcenter[1] = 0;
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index ac1f13e..8f00c0e 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -718,7 +718,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
 				mul_m4_v3(obedit->imat, cent);
 			}
 			else {
-				if (around == V3D_CENTROID) {
+				if (around == V3D_AROUND_CENTER_MEAN) {
 					if (em->bm->totvert) {
 						const float total_div = 1.0f / (float)em->bm->totvert;
 						BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
@@ -825,9 +825,9 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
 				Mesh *me = ob->data;
 
 				if (centermode == ORIGIN_TO_CURSOR) { /* done */ }
-				else if (centermode == ORIGIN_TO_CENTER_OF_MASS) { BKE_mesh_center_centroid(me, cent); }
-				else if (around == V3D_CENTROID)                 { BKE_mesh_center_median(me, cent); }
-				else                                             { BKE_mesh_center_bounds(me, cent); }
+				else if (centermode == ORIGIN_TO_CENTER_OF_MASS)    { BKE_mesh_center_centroid(me, cent); }
+				else if (around == V3D_AROUND_CENTER_MEAN)          { BKE_mesh_center_median(me, cent); }
+				else                                                { BKE_mesh_center_bounds(me, cent); }
 
 				negate_v3_v3(cent_neg, cent);
 				BKE_mesh_translate(me, cent_neg, 1);
@@ -839,9 +839,9 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
 			else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
 				Curve *cu = ob->data;
 
-				if      (centermode == ORIGIN_TO_CURSOR) { /* done */ }
-				else if (around == V3D_CENTROID) { BKE_curve_center_median(cu, cent); }
-				else                             { BKE_curve_center_bounds(cu, cent);   }
+				if      (centermode == ORIGIN_TO_CURSOR)    { /* done */ }
+				else if (around == V3D_AROUND_CENTER_MEAN)  { BKE_curve_center_median(cu, cent); }
+				else                                        { BKE_curve_center_bounds(cu, cent); }
 
 				/* don't allow Z change if curve is 2D */
 				if ((ob->type == OB_CURVE) && !(cu->flag & CU_3D))
@@ -921,9 +921,9 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
 			else if (ob->type == OB_MBALL) {
 				MetaBall *mb = ob->data;
 
-				if      (centermode == ORIGIN_TO_CURSOR) { /* done */ }
-				else if (around == V3D_CENTROID) { BKE_mball_center_median(mb, cent); }
-				else                             { BKE_mball_center_bounds(mb, cent); }
+				if      (centermode == ORIGIN_TO_CURSOR)    { /* done */ }
+				else if (around == V3D_AROUND_CENTER_MEAN)  { BKE_mball_center_median(mb, cent); }
+				else                                        { BKE_mball_center_bounds(mb, cent); }
 
 				negate_v3_v3(cent_neg, cent);
 				BKE_mball_translate(mb, cent_neg);
@@ -942,9 +942,9 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
 			else if (ob->type == OB_LATTICE) {
 				Lattice *lt = ob->data;
 
-				if      (centermode == ORIGIN_TO_CURSOR) { /* done */ }
-				else if (around == V3D_CENTROID) { BKE_lattice_center_median(lt, cent); }
-				else                             { BKE_lattice_center_bounds(lt, cent); }
+				if      (centermode == ORIGIN_TO_CURSOR)    { /* done */ }
+				else if (around == V3D_AROUND_CENTER_MEAN)  { BKE_lattice_center_median(lt, cent); }
+				else                                        { BKE_lattice_center_bounds(lt, cent); }
 
 				negate_v3_v3(cent_neg, cent);
 				BKE_lattice_translate(lt, cent_neg, 1);
@@ -1044,8 +1044,8 @@ void OBJECT_OT_origin_set(wmOperatorType *ot)
 	};
 	
 	static EnumPropertyItem prop_set_bounds_types[] = {
-		{V3D_CENTROID, "MEDIAN", 0, "Median Center", ""},
-		{V3D_CENTER, "BOUNDS", 0, "Bounds Center", ""},
+		{V3D_AROUND_CENTER_MEAN, "MEDIAN", 0, "Median Center", ""},
+		{V3D_AROUND_CENTER_BOUNDS, "BOUNDS", 0, "Bounds Center", ""},
 		{0, NULL, 0, NULL, NULL}
 	};
 	
@@ -1064,5 +1064,5 @@ void OBJECT_OT_origin_set(wmOperatorType *ot)
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 	
 	ot->prop = RNA_def_enum(ot->srna, "type", prop_set_center_types, 0, "Type", "");
-	RNA_def_enum(ot->srna, "center", prop_set_bounds_types, V3D_CENTROID, "Center", "");
+	RNA_def_enum(ot->srna, "center", prop_set_bounds_types, V3D_AROUND_CENTER_MEAN, "Center", "");
 }
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index c1db31a..7a66599 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -1534,7 +1534,7 @@ static int clip_set_2d_cursor_exec(bContext *C, wmOperator *op)
 	bool show_cursor = false;
 
 	show_cursor |= sclip->mode == SC_MODE_MASKEDIT;
-	show_cursor |= sclip->around == V3D_CURSOR;
+	show_cursor |= sclip->around == V3D_AROUND_CURSOR;
 
 	if (!show_cursor) {
 		return OPERATOR_CANCELLED;
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index 8c4b97b..e1d4e4f 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -250,7 +250,7 @@ static SpaceLink *clip_new(const bContext *C)
 	sc->zoom = 1.0f;
 	sc->path_length = 20;
 	sc->scopes.track_preview_height = 120;
-	sc->around = V3D_LOCAL;
+	sc->around = V3D_AROUND_LOCAL_ORIGINS;
 
 	/* header */
 	ar = MEM_callocN(sizeof(ARegion), "header for clip");
@@ -1213,7 +1213,7 @@ static void clip_main_region_draw(const bContext *C, ARegion *ar)
 	}
 
 	show_cursor |= sc->mode == SC_MODE_MASKEDIT;
-	show_cursor |= sc->around == V3D_CURSOR;
+	show_cursor |= sc->around == V3D_AROUND_CURSOR;
 
 	if (show_cursor) {
 		glPushMatrix();
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 5a006ed..a1c2c8c 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -342,7 +342,7 @@ static SpaceLink *view3d_new(const bContext *C)
 
 	v3d->twflag |= U.tw_flag & V3D_USE_MANIPULATOR;
 	v3d->twtype = V3D_MANIP_TRANSLATE;
-	v3d->around = V3D_CENTROID;
+	v3d->around = V3D_AROUND_CENTER_MEAN;
 	
 	v3d->bundle_size = 0.2f;
 	v3d->bundle_drawtype = OB_PLAINAXES;
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 7458d81..d278d94 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -700,7 +700,7 @@ static bool view3d_orbit_calc_center(bContext *C, float r_dyn_ofs[3])
 	}
 	else {
 		/* If there's no selection, lastofs is unmodified and last value since static */
-		is_set = calculateTransformCenter(C, V3D_CENTROID, lastofs, NULL);
+		is_set = calculateTransformCenter(C, V3D_AROUND_CENTER_MEAN, lastofs, NULL);
 	}
 
 	copy_v3_v3(r_dyn_ofs, lastofs);
@@ -3757,7 +3757,7 @@ static void axis_set_view(bContext *C, View3D *v3d, ARegion *ar,
 			float twmat[3][3];
 
 			/* same as transform manipulator when normal is set */
-			ED_getTransformOrientationMatrix(C, twmat, V3D_ACTIVE);
+			ED_getTransformOrientationMatrix(C, twmat, V3D_AROUND_ACTIVE);
 
 			mat3_to_quat(obact_quat, twmat);
 			invert_qt_normalized(obact_quat);
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c
index 8bb84d0..e8e7d3c 100644
--- a/source/blender/editors/space_view3d/view3d_snap.c
+++ b/source/blender/editors/space_view3d/view3d_snap.c
@@ -223,7 +223,7 @@ static int snap_sel_to_curs_exec(bContext *C, wmOperator *op)
 	cursor_global = ED_view3d_cursor3d_get(scene, 

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list