Need help. I don’t know python or script … but needed to run this script to rename bones from English to Japanese. Does anyone can tell me any thing wrong with this script? I click the “run script” button and it seems to run but the name of bones in the armature did not change. I am using 2.92 …
Appreciate some help with those that understand python …
hi Andrew,
I am not clear what you are saying … are you suggesting that I search google for a python scripts that does bone remapping and try it out myself?
The thing is … I don’t know python . perhaps just wanted to know if the scripts I got in this example is a “valid” python script and am I right to just click the “play button” and it should run with some message that appears on the bottom window (a console I think) ??
Yes, I am saying that you can search in google your self. It is much better then you can ask other because you can ask the people and also people can tell you but you can’t understand So, that’s why I can say that. Don’t mind.
Be Happy Thanks
I’m pretty noob with Python and Blender API, but I think this should work. Select your target armature, I don’t think it matters if you are in edit or object mode. Simply replace the dictionary items with your data.
import bpy
def rename_bones():
dict = {
'bone0': 'foo0',
'bone1': 'foo1'
}
for b in bpy.context.object.data.bones:
if b.name in dict.keys():
b.name = dict[b.name]
rename_bones()
That .keys if will allow you to skip incorrectly named bones or extra bones which don’t have their name in dictionary.
Hi ezez,
Thanks so much … I used your scripts and works wonderfully. I am able to rename all my target armature’s bones now and able now to transfer bvh animation now to mmd rig. Your knowledge of Python clearly surpass me
And thanks bartv for speaking for me.
Indeed I do need help and had received it with ezez solution.