Python API: expose the math mapping vertex positions to B-Bone segments #105419

Merged
Alexander Gavrilov merged 1 commits from angavrilov/blender:pr-pyapi-bbone-weight into main 2023-08-03 14:44:46 +02:00

1 Commits

Author SHA1 Message Date
Alexander Gavrilov 755dcee650 Python API: expose the math mapping vertex positions to B-Bone segments.
Recently a user expressed interest in exporting baked animation
with B-Bone segments. Currently the python API already exposes
segment matrices via a PoseBone method, but there is no access
to the mapping of vertices to the segments.

Although currently the math is simple and easy to re-implement,
forcing Python add-ons to do that would cause a maintenance issue
if the mapping is ever changed later (it's quite dumb, ignoring
the rest pose curve, and there definitely is room for improvement).

This patch extracts the relevant math into a BKE function, and
exposes it in the python API as a new PoseBone method.
2023-08-03 13:53:19 +03:00