I have a model that has 4 track with 48 track pads per track. I’ve animated a complete cycle for each set. I decided to rename the bones in the 4 sets after I completed the animation and did it via a rename script. That work great, however, it totally disconnected the animations. My bones are named something new and the animations retained the old curve/pose.bone names. I’ve struggled through a bunch of code, found a way to change the curve names to the new bone name but the embedded pose.bones[“trk_pad_R.008”].location, pose.bones[“trk_pad_R.008”].rotation_quaternion, etc pose.bone name retained the old names.
I know that if I can change these names the animations will work again because I’ve proved it manually. I’m hoping to do this through code because each pad has a xyz location, scale and a wxyz quaternion rotation that have to be changed.
If someone can just show me how to change this list bones code to list the pose.bones, I might be able to work out the rest.
import bpy
for object in bpy.context.selected_objects[0].data.bones:
print(object.name)
I changed the bone names using a Dictionary of names and this code
import bpybones = bpy.context.selected_objects[0].data.bones
if (bones):
for bone in bones:
newName = names.get(bone.name)
if (newName):
bone.name = newName
Then modified that to change the curve names. (which changed the names of the main bones/curves in the Animation Editor as well.)
I just need to change the Pose.Bone names now and everything should work. Every method, object or property I’ve tried results in an Error Such and such does not have a pose.bone attribute.
Thanks
Pte Jack