3
$\begingroup$

I need to write a script, which makes sure, that the tip of my armature never gets under the ground, which will be a flat plane. how would i access the global position of the posebones tail? The bones tail must not be under the ground

$\endgroup$

1 Answer 1

8
$\begingroup$

If you have your armature object as arm, you can get its nth bone’s tail local position (i.e. its pose location in armature’s object space) with arm.pose.bones[n].tail, so to get that in world coordinates, just multiply it with the armature’s world matrix: arm.matrix_world * arm.pose.bones[n].tail.

Note however it may be simpler (in simple cases) to use a bone constraint like Floor or Limit Position ones…

$\endgroup$

You must log in to answer this question.

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