Batch "Copy Transform" Script

Hi! for anyone exporting their customs rigs to game engines, I figured out a pretty useful little script. Once you made a duplicate of “DEF” bones and changed their name to “TGT”, You would select “DEF” Bones in Pose mode and run this script.

Hope it helps!
(Not really sure if it would work with rigify, I guess it does work but I haven’t tried, so if you do let everyone know!)

import bpy

for bone in bpy.context.selected_pose_bones:
bconstraint =‘COPY_TRANSFORMS’) = bpy.context.active_object
bconstraint.subtarget =‘DEF’, ‘TGT’)