[Bf-blender-cvs] [d12ab9a] master: Remove unused armature code

Campbell Barton noreply at git.blender.org
Fri Mar 20 16:18:13 CET 2015


Commit: d12ab9a9a8c39733c35e4c967cee52eb7d274b4b
Author: Campbell Barton
Date:   Fri Mar 20 23:55:47 2015 +1100
Branches: master
https://developer.blender.org/rBd12ab9a9a8c39733c35e4c967cee52eb7d274b4b

Remove unused armature code

ED_armature_deselect_all now simply de-selects

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

M	source/blender/editors/armature/armature_add.c
M	source/blender/editors/armature/armature_edit.c
M	source/blender/editors/armature/armature_select.c
M	source/blender/editors/include/ED_armature.h
M	source/blender/editors/space_outliner/outliner_select.c

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

diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c
index c2158f0..8074182 100644
--- a/source/blender/editors/armature/armature_add.c
+++ b/source/blender/editors/armature/armature_add.c
@@ -90,7 +90,7 @@ EditBone *ED_armature_edit_bone_add_primitive(Object *obedit_arm, float length,
 	bArmature *arm = obedit_arm->data;
 	EditBone *bone;
 
-	ED_armature_deselect_all(obedit_arm, 0);
+	ED_armature_deselect_all(obedit_arm);
 	
 	/* Create a bone */
 	bone = ED_armature_edit_bone_add(arm, "Bone");
@@ -145,7 +145,7 @@ static int armature_click_extrude_exec(bContext *C, wmOperator *UNUSED(op))
 		to_root = 1;
 	}
 	
-	ED_armature_deselect_all(obedit, 0);
+	ED_armature_deselect_all(obedit);
 	
 	/* we re-use code for mirror editing... */
 	flipbone = NULL;
@@ -914,7 +914,7 @@ static int armature_bone_primitive_add_exec(bContext *C, wmOperator *op)
 	mul_m3_m3m3(totmat, obmat, viewmat);
 	invert_m3_m3(imat, totmat);
 	
-	ED_armature_deselect_all(obedit, 0);
+	ED_armature_deselect_all(obedit);
 	
 	/*	Create a bone	*/
 	bone = ED_armature_edit_bone_add(obedit->data, name);
diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c
index 6fe4cbf..29b7872 100644
--- a/source/blender/editors/armature/armature_edit.c
+++ b/source/blender/editors/armature/armature_edit.c
@@ -714,7 +714,7 @@ static int armature_fill_bones_exec(bContext *C, wmOperator *op)
 	}
 
 	if (newbone) {
-		ED_armature_deselect_all(obedit, 0);
+		ED_armature_deselect_all(obedit);
 		arm->act_edbone = newbone;
 		newbone->flag |= BONE_TIPSEL;
 	}
diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c
index 5061ba9..720b9b7 100644
--- a/source/blender/editors/armature/armature_select.c
+++ b/source/blender/editors/armature/armature_select.c
@@ -388,61 +388,14 @@ static EditBone *get_nearest_editbonepoint(ViewContext *vc, const int mval[2],
 	return NULL;
 }
 
-
-
-/* toggle==0: deselect
- * toggle==1: swap (based on test)
- * toggle==2: swap (no test), CURRENTLY UNUSED
- */
-void ED_armature_deselect_all(Object *obedit, int toggle)
+void ED_armature_deselect_all(Object *obedit)
 {
 	bArmature *arm = obedit->data;
-	EditBone    *eBone;
-	int sel = 1;
-	
-	if (toggle == 1) {
-		/* Determine if there are any selected bones
-		 * and therefore whether we are selecting or deselecting */
-		for (eBone = arm->edbo->first; eBone; eBone = eBone->next) {
-			//			if (arm->layer & eBone->layer) {
-			if (eBone->flag & (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL)) {
-				sel = 0;
-				break;
-			}
-			//			}
-		}
-	}
-	else {
-		sel = toggle;
-	}
+	EditBone *ebone;
 
-	/*	Set the flags */
-	for (eBone = arm->edbo->first; eBone; eBone = eBone->next) {
-		if (sel == 2) {
-			/* invert selection of bone */
-			if (EBONE_VISIBLE(arm, eBone)) {
-				eBone->flag ^= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
-				if (arm->act_edbone == eBone)
-					arm->act_edbone = NULL;
-			}
-		}
-		else if (sel == 1) {
-			/* select bone */
-			if (EBONE_VISIBLE(arm, eBone)) {
-				eBone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
-				if (eBone->parent)
-					eBone->parent->flag |= (BONE_TIPSEL);
-			}
-		}
-		else {
-			/* deselect bone */
-			eBone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
-			if (arm->act_edbone == eBone)
-				arm->act_edbone = NULL;
-		}
+	for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
+		ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
 	}
-	
-	ED_armature_sync_selection(arm->edbo);
 }
 
 void ED_armature_deselect_all_visible(Object *obedit)
@@ -489,8 +442,9 @@ bool mouse_armature(bContext *C, const int mval[2], bool extend, bool deselect,
 	nearBone = get_nearest_editbonepoint(&vc, mval, arm->edbo, 1, &selmask);
 	if (nearBone) {
 
-		if (!extend && !deselect && !toggle)
-			ED_armature_deselect_all(obedit, 0);
+		if (!extend && !deselect && !toggle) {
+			ED_armature_deselect_all(obedit);
+		}
 		
 		/* by definition the non-root connected bones have no root point drawn,
 		 * so a root selection needs to be delivered to the parent tip */
diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h
index b08cc12..da75642 100644
--- a/source/blender/editors/include/ED_armature.h
+++ b/source/blender/editors/include/ED_armature.h
@@ -119,7 +119,7 @@ void ED_keymap_armature(struct wmKeyConfig *keyconf);
 void ED_armature_from_edit(struct bArmature *arm);
 void ED_armature_to_edit(struct bArmature *arm);
 void ED_armature_edit_free(struct bArmature *arm);
-void ED_armature_deselect_all(struct Object *obedit, int toggle);
+void ED_armature_deselect_all(struct Object *obedit);
 void ED_armature_deselect_all_visible(struct Object *obedit);
 
 int ED_do_pose_selectbuffer(struct Scene *scene, struct Base *base, unsigned int *buffer, 
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 730ee02..6050b66 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -618,7 +618,7 @@ static eOLDrawState tree_element_active_ebone(
 	if (set != OL_SETSEL_NONE) {
 		if (set == OL_SETSEL_NORMAL) {
 			if (!(ebone->flag & BONE_HIDDEN_A)) {
-				ED_armature_deselect_all(scene->obedit, 0); // deselect
+				ED_armature_deselect_all(scene->obedit);
 				tree_element_active_ebone__sel(C, scene, arm, ebone, true);
 				status = OL_DRAWSEL_NORMAL;
 			}




More information about the Bf-blender-cvs mailing list