Jump to content

Blender: Difference between revisions

392 bytes added ,  15 September 2021
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 body_part.bone[0].constraints[0].mute==0:
 
    value=1
#Search all bones in body parts for the first bone with constraint.
else:
for bone in body_part:
    value=0
    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:
191

edits