I have a script made for 3dsmax that renames bones in batch like this:
( local nameMap = #( \
dataPair "Bip01_" "",
dataPair "Neck01" "Neck",
dataPair "phy_anchor_Skirt_00" "Pelvis",
And so on and so forth. How can I make the same for blender? Does anybody have something working, so I can just change the name of the bones, and press 'Run Script'?
Because as far as I can do, it only change exact names and not part of the name, this is what I've got:
import bpy
context = bpy.context
obj = context.object
namelist = [("Bip01_", "")]
for name, newname in namelist:
# get the pose bone with name
pb = obj.pose.bones.get(name)
# continue if no bone of that name
if pb is None:
continue
# rename
pb.name = newname
What I would like that script to do is change ALL 'Bip01_' for nothing, like deleting a prefix.