0
$\begingroup$

I need to get the actual pose bone head and tail position at a particular frame in world space during the animation. Want to avoid calling bpy.context.scene.frame_set as it is quite expensive. Is there a way to get that?

I have tried with fcurve.evaluate, but it only returns location and rotation_quaternion and doesn't take care of the parent-child relations and other things impacting bone location (please refer to Calculating transformation matrix of a pose bone).

Any help or pointers would be appreciated.

$\endgroup$

1 Answer 1

0
$\begingroup$

Following the answer to: Calculate a pose bone's transformation matrix from its F-curve without updating

matrix = matrix_map[bone.name]
matrixGlobal = bone.id_data.matrix_world @ matrix
headGlobalPos = matrixGlobal.translation

matrix.translation.z += bone.length
matrixGlobal = bone.id_data.matrix_world @ matrix
tailGlobalPos = matrixGlobal.translation

(this seems to be working, let me know if there are corrections / refinements)

$\endgroup$

You must log in to answer this question.

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