191
edits
Line 107: | Line 107: | ||
<pre>#ObjectConstraintEnabler | <pre>#ObjectConstraintEnabler | ||
import bpy | import bpy | ||
body_parts = bpy.context.selected_objects | body_parts = bpy.context.selected_objects #All selected objects | ||
if | |||
#Search all objects in body parts for the first object with constraint. | |||
else: | for part in body_parts: | ||
if len(part.constraints)>0: | |||
if part.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 body_part in body_parts: | for body_part in body_parts: | ||
for con in body_part.constraints: | for con in body_part.constraints: |
edits