Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import bpy
- def connect_bones(from_armature, to_armature):
- armature_rig = bpy.data.objects[from_armature]
- armature_deform = bpy.data.objects[to_armature]
- rig_bones = [i for i in armature_rig.pose.bones]
- for rig_bone in rig_bones:
- deform_bone = armature_deform.pose.bones.get(rig_bone.name.replace("rig", "deform"))
- if not deform_bone:
- continue
- # remove deform contraints
- for con in deform_bone.constraints:
- deform_bone.constraints.remove(con)
- # create constraint
- copy_con = deform_bone.constraints.new('COPY_TRANSFORMS')
- copy_con.target = armature_rig
- copy_con.subtarget = rig_bone.name
- copy_con.target_space = 'POSE'
- copy_con.owner_space = 'POSE'
- connect_bones('Rabbit_Rig', 'Rabbit_Deform')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement