[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43355] trunk/blender/source/blender/ editors/transform: Fix #29873: transform with individual origins not working in edge select mode.

Brecht Van Lommel brechtvanlommel at pandora.be
Fri Jan 13 15:56:47 CET 2012


Revision: 43355
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43355
Author:   blendix
Date:     2012-01-13 14:56:41 +0000 (Fri, 13 Jan 2012)
Log Message:
-----------
Fix #29873: transform with individual origins not working in edge select mode.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/transform/transform.c
    trunk/blender/source/blender/editors/transform/transform_conversions.c

Modified: trunk/blender/source/blender/editors/transform/transform.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform.c	2012-01-13 12:34:41 UTC (rev 43354)
+++ trunk/blender/source/blender/editors/transform/transform.c	2012-01-13 14:56:41 UTC (rev 43355)
@@ -2632,7 +2632,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_FACE)) ||
+	            ((t->flag & T_EDIT) && (t->settings->selectmode & (SCE_SELECT_EDGE|SCE_SELECT_FACE))) ||
 	            (t->obedit && t->obedit->type == OB_ARMATURE))
 	        )
 	{
@@ -2919,7 +2919,7 @@
 	/* local constraint shouldn't alter center */
 	if (around == V3D_LOCAL) {
 		if (    (t->flag & (T_OBJECT|T_POSE)) ||
-		        (t->settings->selectmode & SCE_SELECT_FACE) ||
+	            (t->settings->selectmode & (SCE_SELECT_EDGE|SCE_SELECT_FACE)) ||
 		        (t->obedit && t->obedit->type == OB_ARMATURE))
 		{
 			center = td->center;

Modified: trunk/blender/source/blender/editors/transform/transform_conversions.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_conversions.c	2012-01-13 12:34:41 UTC (rev 43354)
+++ trunk/blender/source/blender/editors/transform/transform_conversions.c	2012-01-13 14:56:41 UTC (rev 43355)
@@ -1926,6 +1926,19 @@
 	}
 }
 
+static void get_edge_center(float *cent, EditMesh *em, EditVert *eve)
+{
+	EditEdge *eed;
+
+	for(eed= em->edges.first; eed; eed= eed->next)
+		if(eed->f & SELECT)
+			if(eed->v1==eve || eed->v2==eve)
+				break;
+	if(eed) {
+		mid_v3_v3v3(cent, eed->v1->co, eed->v2->co);
+	}
+}
+
 /* way to overwrite what data is edited with transform
  * static void VertsToTransData(TransData *td, EditVert *eve, BakeKey *key) */
 static void VertsToTransData(TransInfo *t, TransData *td, EditMesh *em, EditVert *eve)
@@ -1937,8 +1950,12 @@
 	td->loc = eve->co;
 
 	copy_v3_v3(td->center, td->loc);
-	if(t->around==V3D_LOCAL && (em->selectmode & SCE_SELECT_FACE))
-		get_face_center(td->center, em, eve);
+	if(t->around==V3D_LOCAL) {
+		if(em->selectmode & SCE_SELECT_FACE)
+			get_face_center(td->center, em, eve);
+		else if(em->selectmode & SCE_SELECT_EDGE)
+			get_edge_center(td->center, em, eve);
+	}
 	copy_v3_v3(td->iloc, td->loc);
 
 	// Setting normals



More information about the Bf-blender-cvs mailing list