Guest User

Untitled

a guest
Nov 20th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. import bpy
  2.  
  3. for b in bpy.context.selected_pose_bones:
  4. for c in b.constraints:
  5. if c.name == "Stretch To":
  6. c.rest_length = 0
  7.  
  8. import bpy
  9.  
  10. ob = bpy.context.active_object
  11.  
  12. # Take a copy of current layers
  13. org_layers = ob.data.layers[:]
  14.  
  15. # Show all layers
  16. for i in range(len(org_layers)):
  17. ob.data.layers[i] = True
  18.  
  19. for b in ob.pose.bones:
  20. for c in b.constraints:
  21. if c.type == "CHILD_OF":
  22. context_py = bpy.context.copy()
  23. context_py["constraint"] = c
  24. ob.data.bones.active = b.bone
  25. bpy.ops.constraint.childof_set_inverse(context_py, constraint="Child Of", owner='BONE')
  26.  
  27. # Reset back to orginal layer state
  28. for i in range(len(org_layers)):
  29. ob.data.layers[i] = org_layers[i]
Add Comment
Please, Sign In to add comment