use armature active bone as a pointer rather then a flag for each bone that needs...
[blender.git] / source / blender / editors / space_view3d / view3d_draw.c
index 247800c30771681a05134f48a320032a035e9e16..2879dc3ed226bb25e79abb79b1b8a62fcac16a04 100644 (file)
@@ -791,21 +791,17 @@ static void draw_selected_name(Scene *scene, Object *ob, View3D *v3d)
                        
                        /* show name of active bone too (if possible) */
                        if(arm->edbo) {
-                               EditBone *ebo;
-                               for (ebo=arm->edbo->first; ebo; ebo=ebo->next){
-                                       if ((ebo->flag & BONE_ACTIVE) && (ebo->layer & arm->layer)) {
-                                               name= ebo->name;
-                                               break;
-                                       }
-                               }
+
+                               if(arm->act_edbone)
+                                       name= ((EditBone *)arm->act_edbone)->name;
+
                        }
-                       else if(ob->pose && (ob->mode & OB_MODE_POSE)) {
-                               bPoseChannel *pchan;
-                               for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
-                                       if((pchan->bone->flag & BONE_ACTIVE) && (pchan->bone->layer & arm->layer)) {
-                                               name= pchan->name;
-                                               break;
-                                       }
+                       else if(ob->mode & OB_MODE_POSE) {
+                               if(arm->act_bone) {
+
+                                       if(arm->act_bone->layer & arm->layer)
+                                               name= arm->act_bone->name;
+
                                }
                        }
                        if(name && markern)