2
$\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$
6
$\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…

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.