[Bf-blender-cvs] [f801f80] master: fix for active bone not saving in editmode.

Campbell Barton noreply at git.blender.org
Fri Nov 22 00:50:31 CET 2013


Commit: f801f8057da824a2306963ea1b10bb5917a267c7
Author: Campbell Barton
Date:   Fri Nov 22 10:36:35 2013 +1100
http://developer.blender.org/rBf801f8057da824a2306963ea1b10bb5917a267c7

fix for active bone not saving in editmode.

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

M	source/blender/editors/armature/armature_utils.c
M	source/blender/editors/interface/interface_layout.c
M	source/blender/makesdna/DNA_armature_types.h

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

diff --git a/source/blender/editors/armature/armature_utils.c b/source/blender/editors/armature/armature_utils.c
index be26ad5..7d6b371 100644
--- a/source/blender/editors/armature/armature_utils.c
+++ b/source/blender/editors/armature/armature_utils.c
@@ -501,6 +501,7 @@ void ED_armature_from_edit(Object *obedit)
 	
 	/* armature bones */
 	BKE_armature_bonelist_free(&arm->bonebase);
+	arm->act_bone = NULL;
 	
 	/* remove zero sized bones, this gives unstable restposes */
 	for (eBone = arm->edbo->first; eBone; eBone = neBone) {
@@ -634,7 +635,6 @@ void ED_armature_to_edit(Object *ob)
 	ED_armature_edit_free(ob);
 	arm->edbo = MEM_callocN(sizeof(ListBase), "edbo armature");
 	arm->act_edbone = make_boneList(arm->edbo, &arm->bonebase, NULL, arm->act_bone);
-	arm->act_bone = NULL;
 
 //	BIF_freeTemplates(); /* force template update when entering editmode */
 }
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index e3686b7..b85c30b 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -390,11 +390,15 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, in
 			
 			layer_used = arm->layer_used;
 			
-			if (arm->edbo && arm->act_edbone) {
-				layer_active |= arm->act_edbone->layer;
+			if (arm->edbo) {
+				if (arm->act_edbone) {
+					layer_active |= arm->act_edbone->layer;
+				}
 			}
-			else if (arm->act_bone) {
-				layer_active |= arm->act_bone->layer;
+			else {
+				if (arm->act_bone) {
+					layer_active |= arm->act_bone->layer;
+				}
 			}
 		}
 
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h
index 4780b2e..e751966 100644
--- a/source/blender/makesdna/DNA_armature_types.h
+++ b/source/blender/makesdna/DNA_armature_types.h
@@ -88,7 +88,7 @@ typedef struct bArmature {
 	 * - from the user perspective active == last selected
 	 * - active should be ignored when not visible (hidden layer) */
 
-	Bone       *act_bone;               /* active bone (when not in editmode) */
+	Bone       *act_bone;               /* active bone */
 	struct EditBone *act_edbone;        /* active editbone (in editmode) */
 
 	void       *sketch;                 /* sketch struct for etch-a-ton */




More information about the Bf-blender-cvs mailing list