Page MenuHome

RNA: expose access to B-Bone shape data from Python.

Authored by Alexander Gavrilov (angavrilov) on Nov 24 2018, 3:57 PM.



B-Bone shape is a non-trivial computation, so access to
the results would be useful for Python scripts working with
B-Bones, e.g. rig generation.

This exposes both final segment matrices, and the tangent
vectors computed from the custom handle bones.

Since the handle tangents use the axis+roll orientation math
of edit bones, add matrix conversion static methods to Bone.

Diff Detail

rB Blender

Event Timeline

Campbell Barton (campbellbarton) requested changes to this revision.Nov 26 2018, 5:46 AM

No problems exposing bbone calculation to Python but to_axis_roll / AxisRoll don't belong in mathutils.

They're easy to confuse with axis-angle and spesific to Blender's armature implementation.

This could be added as a Bone classmethod, eg: bpy.types.Bone.MatrixFromAxisRoll.

This revision now requires changes to proceed.Nov 26 2018, 5:46 AM

Note, this violates our naming convention, BKE_compute_ isn't a good prefix, could use BKE_pchan_compute_b_bone_handles even if its not taking a pose channel.

Replaced mathutils with static methods in Bone.

This revision is now accepted and ready to land.Nov 26 2018, 10:16 PM
This revision was automatically updated to reflect the committed changes.