[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14401] trunk/blender/source/blender/src/ editmesh_lib.c: active face can now be unselected, also extrude and copy keep the active face.

Campbell Barton ideasman42 at gmail.com
Sat Apr 12 21:56:54 CEST 2008


Revision: 14401
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14401
Author:   campbellbarton
Date:     2008-04-12 21:56:53 +0200 (Sat, 12 Apr 2008)

Log Message:
-----------
active face can now be unselected, also extrude and copy keep the active face.

Modified Paths:
--------------
    trunk/blender/source/blender/src/editmesh_lib.c

Modified: trunk/blender/source/blender/src/editmesh_lib.c
===================================================================
--- trunk/blender/source/blender/src/editmesh_lib.c	2008-04-12 18:44:03 UTC (rev 14400)
+++ trunk/blender/source/blender/src/editmesh_lib.c	2008-04-12 19:56:53 UTC (rev 14401)
@@ -80,7 +80,7 @@
 
 EditFace * EM_get_actFace(int sloppy)
 {
-	if (G.editMesh->act_face && G.editMesh->act_face->f & SELECT) {
+	if (G.editMesh->act_face) {
 		return G.editMesh->act_face;
 	} else if (sloppy) {
 		EditFace *efa= NULL;
@@ -1100,7 +1100,7 @@
 	EditMesh *em = G.editMesh;
 	EditVert *eve, *nextve;
 	EditEdge *eed, *nexted;
-	EditFace *efa, *nextfa;
+	EditFace *efa, *nextfa, *efan;
 	short del_old= 0;
 	ModifierData *md;
 	
@@ -1254,27 +1254,32 @@
 			
 			if(del_old==0) {	// keep old faces means flipping normal
 				if(efa->v4)
-					addfacelist(efa->v4->tmp.v, efa->v3->tmp.v, 
+					efan = addfacelist(efa->v4->tmp.v, efa->v3->tmp.v, 
 								efa->v2->tmp.v, efa->v1->tmp.v, efa, efa);
 				else
-					addfacelist(efa->v3->tmp.v, efa->v2->tmp.v, 
+					efan = addfacelist(efa->v3->tmp.v, efa->v2->tmp.v, 
 								efa->v1->tmp.v, NULL, efa, efa);
 			}
 			else {
 				if(efa->v4)
-					addfacelist(efa->v1->tmp.v, efa->v2->tmp.v, 
+					efan = addfacelist(efa->v1->tmp.v, efa->v2->tmp.v, 
 								efa->v3->tmp.v, efa->v4->tmp.v, efa, efa);
 				else
-					addfacelist(efa->v1->tmp.v, efa->v2->tmp.v, 
+					efan = addfacelist(efa->v1->tmp.v, efa->v2->tmp.v, 
 								efa->v3->tmp.v, NULL, efa, efa);
 			}
-	
+			
+			if (G.editMesh->act_face == efa) {
+				G.editMesh->act_face = efan; 
+			}
+			
 			/* for transform */
 			add_normal_aligned(nor, efa->n);
 		}
 	}
 	
 	if(del_old) {
+		
 		/* step 4: remove old faces, if del_old */
 		efa= em->faces.first;
 		while(efa) {
@@ -1285,7 +1290,8 @@
 			}
 			efa= nextfa;
 		}
-	
+		
+		
 		/* step 5: remove selected unused edges */
 		/* start tagging again */
 		for(eed= em->edges.first; eed; eed= eed->next) eed->f1=0;
@@ -1700,7 +1706,7 @@
 	EditMesh *em = G.editMesh;
 	EditVert *eve, *v1, *v2, *v3, *v4;
 	EditEdge *eed, *newed;
-	EditFace *efa, *newfa;
+	EditFace *efa, *newfa, *act_efa = EM_get_actFace(0);
 
 	EM_clear_flag_all(128);
 	EM_selectmode_set();	// paranoia check, selection now is consistant
@@ -1747,6 +1753,10 @@
 			
 			newfa= addfacelist(v1, v2, v3, v4, efa, efa); 
 			
+			if (act_efa==act_efa) {
+				EM_set_actFace(newfa);
+			}
+			
 			newfa->f= efa->f;
 			efa->f -= flag;
 			efa->f |= 128;





More information about the Bf-blender-cvs mailing list