bpy.ops.armature.duplicate_move() not creating a duplicate I am trying to programmatically add new FK rig controls to a character which is already rigged with deformation bones. To do this, I duplicate a deformation bone for which I want to add a new control, rename it, give it a custom shape, turn off deformation and add a copy transform constraint on deformation bone targeting this new bone. My problem is that when I use the bpy.ops.armature.duplicate_move() operator to duplicate, nothing happens - except that the selected bone is deselected. Here is an example execution on the blender console (I was in armature edit mode when I ran these commands):

&gt;&gt;&gt; len(D.armatures['skeleton_human_female'].edit_bones)
67

&gt;&gt;&gt; C.active_object
bpy.data.objects['skeleton_human_female']

&gt;&gt;&gt; C.active_bone.name
'upperarm_L'

&gt;&gt;&gt; len(C.selected_bones)
1

&gt;&gt;&gt; C.selected_bones[0].name
'upperarm_L'

&gt;&gt;&gt; bpy.ops.armature.duplicate_move()
{'FINISHED'}

&gt;&gt;&gt; len(D.armatures['skeleton_human_female'].edit_bones)
67

&gt;&gt;&gt; len(C.selected_bones)
0


As you can see, the number of bones in the armature doesn't change. I am using blender 2.78c. What could be wrong?

Thanks in advance!

edit: I found that duplicating using duplicate_move() operator is not my favourite way to create new bones in the same position. Instead I just create a new bone, and assign head and tail elements appropriately, using a function like this:

def createNewBone(object, new_bone_name, parent_name, parent_connected, head, tail, roll):
    bpy.ops.object.mode_set(mode='EDIT', toggle=False)

    bpy.ops.armature.bone_primitive_add(name=new_bone_name)

    new_edit_bone = object.data.edit_bones[new_bone_name]
    new_edit_bone.use_connect = parent_connected
    new_edit_bone.parent = object.data.edit_bones[parent_name]    
    new_edit_bone.use_inherit_rotation = True
    new_edit_bone.use_local_location = True
    new_edit_bone.use_inherit_scale = False

    new_edit_bone.head = head
    new_edit_bone.tail = tail
    new_edit_bone.roll = roll
Try this:

import bpy

arm = bpy.data.objects['Armature']
bpy.ops.object.mode_set(mode='EDIT')
bone_to_duplicate = arm.data.edit_bones['Bone']
arm.data.edit_bones.active = bone_to_duplicate
arm.data.edit_bones.active.select = True
bpy.ops.armature.duplicate_move()