Page MenuHome

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

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

Details

Summary

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

Repository
rB Blender

Event Timeline

Campbell Barton (campbellbarton) requested changes to this revision.Mon, Nov 26, 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.Mon, Nov 26, 5:46 AM
source/blender/blenkernel/BKE_armature.h
172

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.Mon, Nov 26, 10:16 PM
This revision was automatically updated to reflect the committed changes.