[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54636] trunk/blender: checking for V3D_LOCAL was duplicated in transform.c, and both checks not quite correct.

Campbell Barton ideasman42 at gmail.com
Mon Feb 18 16:47:13 CET 2013


Revision: 54636
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54636
Author:   campbellbarton
Date:     2013-02-18 15:47:13 +0000 (Mon, 18 Feb 2013)
Log Message:
-----------
checking for V3D_LOCAL was duplicated in transform.c, and both checks not quite correct.
- When checking edimode, make sure its mesh editmode.
- Graph editor supports this option but wasn't being checked.

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/bpy_extras/mesh_utils.py
    trunk/blender/source/blender/editors/transform/transform.c
    trunk/blender/source/blender/makesrna/intern/rna_space.c

Modified: trunk/blender/release/scripts/modules/bpy_extras/mesh_utils.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy_extras/mesh_utils.py	2013-02-18 15:14:34 UTC (rev 54635)
+++ trunk/blender/release/scripts/modules/bpy_extras/mesh_utils.py	2013-02-18 15:47:13 UTC (rev 54636)
@@ -152,8 +152,7 @@
        faces using each edge.
     :rtype: dict
     """
-    
-    #face_edge_keys = [face.edge_keys for face in ]
+
     face_edge_count = {}
     loops = mesh.loops
     edges = mesh.edges

Modified: trunk/blender/source/blender/editors/transform/transform.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform.c	2013-02-18 15:14:34 UTC (rev 54635)
+++ trunk/blender/source/blender/editors/transform/transform.c	2013-02-18 15:47:13 UTC (rev 54636)
@@ -104,6 +104,16 @@
 static void drawEdgeSlide(const struct bContext *C, TransInfo *t);
 static void drawVertSlide(const struct bContext *C, TransInfo *t);
 
+static bool transdata_check_local_center(TransInfo *t)
+{
+	return ((t->around == V3D_LOCAL) && (
+	            (t->flag & (T_OBJECT | T_POSE)) ||
+	            (t->obedit && t->obedit->type == OB_MESH && (t->settings->selectmode & (SCE_SELECT_EDGE | SCE_SELECT_FACE))) ||
+	            (t->obedit && t->obedit->type == OB_ARMATURE) ||
+	            (t->spacetype == SPACE_IPO))
+	        );
+}
+
 /* ************************** SPACE DEPENDANT CODE **************************** */
 
 void setTransformViewMatrices(TransInfo *t)
@@ -3005,12 +3015,7 @@
 	}
 	
 	/* local constraint shouldn't alter center */
-	if ((t->around == V3D_LOCAL) &&
-	    (   (t->flag & (T_OBJECT | T_POSE)) ||
-	        ((t->flag & T_EDIT) && (t->settings->selectmode & (SCE_SELECT_EDGE | SCE_SELECT_FACE))) ||
-	        (t->obedit && t->obedit->type == OB_ARMATURE))
-	    )
-	{
+	if (transdata_check_local_center(t)) {
 		copy_v3_v3(center, td->center);
 	}
 	else if (t->options & CTX_MOVIECLIP) {
@@ -3387,21 +3392,17 @@
 {
 	float vec[3], totmat[3][3], smat[3][3];
 	float eul[3], fmat[3][3], quat[4];
-	float *center = t->center;
+	const float *center;
 
 	/* local constraint shouldn't alter center */
-	if (around == V3D_LOCAL) {
-		if (    (t->flag & (T_OBJECT | T_POSE)) ||
-		        (t->settings->selectmode & (SCE_SELECT_EDGE | SCE_SELECT_FACE)) ||
-		        (t->obedit && t->obedit->type == OB_ARMATURE))
-		{
-			center = td->center;
-		}
-
-		if (t->options & CTX_MOVIECLIP) {
-			center = td->center;
-		}
+	if (transdata_check_local_center(t) ||
+	    ((around == V3D_LOCAL) && (t->options & CTX_MOVIECLIP)))
+	{
+		center = td->center;
 	}
+	else {
+		center = t->center;
+	}
 
 	if (t->flag & T_POINTS) {
 		mul_m3_m3m3(totmat, mat, td->mtx);

Modified: trunk/blender/source/blender/makesrna/intern/rna_space.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_space.c	2013-02-18 15:14:34 UTC (rev 54635)
+++ trunk/blender/source/blender/makesrna/intern/rna_space.c	2013-02-18 15:47:13 UTC (rev 54636)
@@ -2548,7 +2548,7 @@
 		{0, NULL, 0, NULL, NULL}
 	};
 		
-	/* this is basically the same as the one for the 3D-View, but with some entries ommitted */
+	/* this is basically the same as the one for the 3D-View, but with some entries omitted */
 	static EnumPropertyItem gpivot_items[] = {
 		{V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""},
 		{V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},




More information about the Bf-blender-cvs mailing list