191
edits
Line 120: | Line 120: | ||
<pre>#BoneConstraintEnabler | <pre>#BoneConstraintEnabler | ||
import bpy | import bpy | ||
body_part = bpy.context.selected_pose_bones_from_active_object | body_part = bpy.context.selected_pose_bones_from_active_object #All bones in the rig | ||
if | |||
#Search all bones in body parts for the first bone with constraint. | |||
else: | for bone in body_part: | ||
if len(bone.constraints)>0: | |||
if bone.constraints[0].mute==0: #At this point, check if the first constraint in the bone is enabled or disabled... | |||
value=1 #...and set the value as invertion of that | |||
else: | |||
value=0 | |||
break #Break the loop as we just need the first mute value we will run into | |||
for bone in body_part: | for bone in body_part: | ||
for con in bone.constraints: | for con in bone.constraints: |
edits