I'm auto generating my armature, and after extruding a bone, I'd like set its name. This will help me reference it later, so I can parent other bones to it.

Right now I'm extruding the bone with this:


But that action doesn't have an option for the bone name, and now I don't know how to get it. Normally I would get the bone I need by name, like this:

bone = bpy.context.active_object.data.edit_bones['Bone_Name']

...but without knowing the name, now I don't know how to get it. I really want to be able to set that name in the script. Anyone know how?


1 Answer 1


Turns out you can get the last bone and set the name like this:

bpy.context.active_object.data.edit_bones[-1].name = 'name'

Which, coming from other languages, looks insane to me, but it works.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .