Blender: Difference between revisions

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

edits