I have a bone and two empties, how in edit mode I can move the head of the bone to the location of empty1 and the tip to the location of empty2 using python?
I'm trying the below script but it doesn't work as I want it to move to the empty location as highlighted below.
import bpy
bpy.ops.object.select_all(action='DESELECT')
obj = bpy.data.objects['metarig']
obj.select = True
bpy.context.scene.objects.active = obj
bpy.ops.object.mode_set(mode='EDIT')
emp = bpy.data.objects['Empty']
for bone in obj.data.edit_bones:
if bone.name == 'hips':
bone.head = emp.location

