[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18825] branches/blender2.5/blender/source /blender/editors/armature/editarmature.c: 2.5

Joshua Leung aligorith at gmail.com
Fri Feb 6 11:05:07 CET 2009


Revision: 18825
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18825
Author:   aligorith
Date:     2009-02-06 11:04:44 +0100 (Fri, 06 Feb 2009)

Log Message:
-----------
2.5 

Converted all countall() calls in armature code to armature_sync_selection() 

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/armature/editarmature.c

Modified: branches/blender2.5/blender/source/blender/editors/armature/editarmature.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/armature/editarmature.c	2009-02-06 01:39:55 UTC (rev 18824)
+++ branches/blender2.5/blender/source/blender/editors/armature/editarmature.c	2009-02-06 10:04:44 UTC (rev 18825)
@@ -103,24 +103,23 @@
 static void error_libdata() {}
 static void BIF_undo_push() {}
 static void adduplicate() {}
-static void countall() {}
 /* ************* XXX *************** */
 
 /* **************** tools on Editmode Armature **************** */
 
 /* Sync selection to parent for connected children */
-// XXX this is really buggy code! do not use this for now - Aligorith, 6Feb2009
 static void armature_sync_selection(ListBase *edbo)
 {
 	EditBone *ebo;
 	
 	for (ebo=edbo->first; ebo; ebo= ebo->next) {
-		if ((ebo->flag & BONE_CONNECTED) && ebo->parent){
+		if ((ebo->flag & BONE_CONNECTED) && (ebo->parent)) {
 			if (ebo->parent->flag & BONE_TIPSEL)
 				ebo->flag |= BONE_ROOTSEL;
 			else
 				ebo->flag &= ~BONE_ROOTSEL;
 		}
+		
 		if ((ebo->flag & BONE_TIPSEL) && (ebo->flag & BONE_ROOTSEL))
 			ebo->flag |= BONE_SELECTED;
 		else
@@ -1040,8 +1039,6 @@
 	
 	/* recalc/redraw + cleanup */
 	waitcursor(0);
-
-	countall(); // flush!
 	
 	BIF_undo_push("Separate Armature");
 }
@@ -1249,7 +1246,7 @@
 		}
 	}
 
-	countall(); // flushes selection!
+	armature_sync_selection(arm->edbo);
 	
 	if (direction==BONE_SELECT_PARENT)
 		BIF_undo_push("Select edit bone parent");
@@ -1382,7 +1379,8 @@
 		selectconnected_posebonechildren (ob, curBone);
 	}
 	
-	countall(); // flushes selection!
+		// XXX this only counted the number of pose channels selected
+	//countall(); // flushes selection!
 
 	BIF_undo_push("Select connected");
 
@@ -1446,7 +1444,7 @@
 
 	}
 
-	countall(); // flushes selection!
+	armature_sync_selection(arm->edbo);
 
 	BIF_undo_push("Select connected");
 
@@ -1652,7 +1650,7 @@
 	}
 	
 	
-	countall(); // flushes selection!
+	armature_sync_selection(arm->edbo);
 	
 	BIF_undo_push("Delete bone(s)");
 }
@@ -1709,7 +1707,7 @@
 		}
 	}
 	
-	countall(); // flushes selection!
+	armature_sync_selection(arm->edbo);
 	if (doundo) {
 		if (sel==1) BIF_undo_push("Select All");
 		else BIF_undo_push("Deselect All");
@@ -2125,7 +2123,7 @@
 	/* no primitive support yet */
 	add_primitive_bone(scene, v3d, rv3d, newob);
 	
-	countall(); // flushes selection!
+	//armature_sync_selection(arm->edbo); // XXX which armature?
 
 	if ((newob) && !(U.flag & USER_ADD_EDITMODE)) {
 		ED_armature_from_edit(scene, obedit);
@@ -2213,7 +2211,7 @@
 		
 	}
 	
-	countall();
+	armature_sync_selection(arm->edbo);
 	
 	BIF_undo_push("Add Bone");
 }
@@ -2304,7 +2302,7 @@
 	EditBone	*curBone;
 	EditBone	*firstDup=NULL;	/*	The beginning of the duplicated bones in the edbo list */
 	
-	countall(); // flushes selection!
+	armature_sync_selection(arm->edbo); // XXX why is this needed?
 
 	/* Select mirrored bones */
 	if (arm->flag & ARM_MIRROR_EDIT) {
@@ -2820,7 +2818,7 @@
 	}
 	
 	/* undo + updates */
-	countall();
+	armature_sync_selection(arm->edbo);
 	BIF_undo_push("Merge Bones");
 }
 
@@ -2842,7 +2840,7 @@
 			}
 		}
 	}
-	countall();
+	armature_sync_selection(arm->edbo);
 	BIF_undo_push("Hide Bones");
 }
 
@@ -2862,7 +2860,7 @@
 			}
 		}
 	}
-	countall();
+	armature_sync_selection(arm->edbo);
 	BIF_undo_push("Hide Unselected Bones");
 }
 
@@ -2880,7 +2878,7 @@
 			}
 		}
 	}
-	countall();
+	armature_sync_selection(arm->edbo);
 	BIF_undo_push("Reveal Bones");
 }
 
@@ -3026,7 +3024,7 @@
 		}
 	}
 
-	countall(); /* checks selection */
+	armature_sync_selection(arm->edbo);
 	BIF_undo_push("Make Parent");
 
 	return;
@@ -3067,7 +3065,7 @@
 		}
 	}
 	
-	countall(); // checks selection
+	armature_sync_selection(arm->edbo);
 	BIF_undo_push("Clear Parent");
 }
 	
@@ -3194,7 +3192,7 @@
 	if (totbone==1 && first) first->flag |= BONE_ACTIVE;
 	
 	/* Transform the endpoints */
-	countall(); // flushes selection!
+	armature_sync_selection(arm->edbo);
 // XXX	BIF_TransformSetUndo("Extrude");
 //	initTransform(TFM_TRANSLATION, CTX_NO_PET);
 //	Transform();
@@ -3621,7 +3619,7 @@
 		}
 	}
 	
-	countall();
+	//countall(); // XXX need an equivalent to this...
 	
 	if (doundo) {
 		if (selectmode==1) BIF_undo_push("Select All");





More information about the Bf-blender-cvs mailing list