Results 1 to 2 of 2
  1. #1

    How can I get a bone position in pose mode ?


    I'm trying to write a script for automatic animation, but I'm stuck in getting the bone position in pose mode. Could anyone point me the good method ?

    So far, I
    • Get the armature using bpy.context.objects['Armature']
    • Reference the bones by['NameOfTheBone']
    • I'm able to move the bones by script by selecting them through['NameOfTheBone'].select = True and bpy.ops.transform.translate/rotate
    • However, I can't figure out how to get their positions in pose mode

    Any tips ?

    Thanks a lot !

  2. #2
    Hi. If you hover over GUI fields you'll be shown the relevant bpy for your desired data. So in pose mode mouse over location for instance. Another helpful feature is hidden in the Info window (Top bar mostly, has the File menu). If pulled down it will display alternate paths to data when altered. Try the Scripting layout if my explanation is unclear. In pose mode translate a bone and observe the Info window. Right click anything you want to copy from there for your script.

    Info window gave bpy.context.object.pose.bones["Bone"].location[:]
    Hovering the mouse gives

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts