use armature active bone as a pointer rather then a flag for each bone that needs...
[blender.git] / source / blender / editors / sculpt_paint / paint_vertex.c
index 408f4862b6f284efdfc53a25227e5d3a3cf21e1a..2045397f3c9b9aad7925b96c075fdf2ab95e9ca7 100644 (file)
@@ -1104,12 +1104,10 @@ static int set_wpaint(bContext *C, wmOperator *op)              /* toggle */
                /* verify if active weight group is also active bone */
                par= modifiers_isDeformedByArmature(ob);
                if(par && (par->mode & OB_MODE_POSE)) {
-                       bPoseChannel *pchan;
-                       for(pchan= par->pose->chanbase.first; pchan; pchan= pchan->next)
-                               if(pchan->bone->flag & BONE_ACTIVE)
-                                       break;
-                               if(pchan)
-                                       ED_vgroup_select_by_name(ob, pchan->name);
+                       bArmature *arm= ob->data;
+
+                       if(arm->act_bone)
+                               ED_vgroup_select_by_name(ob, arm->act_bone->name);
                }
        }
        else {