Changing Bone Names in a Script

Hey, this is just a quick hack because I hate renaming a large number of bones with the mouse for some reason . . . .

It looks like it should work. It runs through the selected bones and lets you type in new names. But then nothing changes. Help?

Note - searching didn’t turn up anything useful and searching for “bone name” on these forums drops the “name” keyword because it’s considered ‘too common’ somehow.

Name: 'Z Type In Names'
Blender: 245
Group: 'Object'
Tooltip: 'Rename all selected objects consecutavely'
__author__ = "Star Weaver"
__url__ = ("blender", "elysiun")
__version__ = "0.0"

__bpydoc__ = """\
Stuff goes in here

from Blender import *
import bpy

def main():

    print Window.EditMode()

    if Window.EditMode():
        aobj = Scene.GetCurrent().getActiveObject()
        if aobj and aobj.type == "Armature":
            print aobj

            arma =
            selbones = []

            for bone in arma.bones.values():
                print bone, bone.options
                if Armature.BONE_SELECTED in bone.options:

            for bone in selbones:
                name = Draw.PupStrInput("Rename " + + " >>",, 21)
       = name


if __name__=='__main__':

Dude, now I see that it’s renaming the things, and creating a whole nother bone hierarchy in the armature with the new names. WTH?