Completely new to scripting and was hoping someone would help me out here.
I've imported a rig twice and want to add a "Child Of" bone constraint to each bone in the first rig using the matching bone in the second rig as the target. I also want to use "Set Inverse" function of this constraint.
The rigs are the same, so all the bones are named the same.
Rigs are called "root" and "root.001".
I figure I need to do something with:
import bpy context = bpy.context scene = context.scene rig1 = scene.objects.get("root") rig2 = scene.objects.get("root.001") for bone in rig1.pose.bones: cbone = bone cbname = bone.name setchild = bone.constraints.new(type='CHILD_OF') setchild.target = rig2 setchild.subtarget = cbname
But beyond that I have no clue. I'm not sure how to set the inverse option.
I'm looking to edit a number of animation files, so would need to do this process for each fbx file, and therefore would love to automate the process.
Hoping someone can help me out. Cheers.