I'm trying to code a script that will copy the rotations of the bones from one rig to another on all the bones
ob = bpy.context.object altob = bpy.data.objects["Armature.001"] if (ob.type == 'ARMATURE') & (altob.type == 'ARMATURE'): armature = ob.data altarmature = altob.data for bone in armature.bones: for altbone in altarmature.bones: if bone.name == altbone.name: #crc = bone.constraints.new('COPY_ROTATION') #crc.target = altob #crc.subtarget = altbone.name print(bone.name + " = " + altbone.name)
so if I just have the print names of the bones then I get all the bones matching like this:
but with the other code where I try to make a new constraint and set the other rig as the target and the correct bone as the subtarget then I get the message at the top of the screen shot where it tells me the bone has no attribute 'constraints'.
Can someone tell me what I'm doing wrong? I'm using 2.80 (I need this specific version to make this project work)