Use full transformation of B-Bone segments in Copy Transforms.
ClosedPublic

Authored by Alexander Gavrilov (angavrilov) on Jul 14 2018, 4:52 PM.

Details

Summary

Currently constraints can only read the location along the spline.
This obviously limits opportunities for complex bone interactions
in rigs.

This patch exposes access to rotation and scale as well. However,
due to the way how things work, this data cannot be smoothly
interpolated, and abruptly changes when switching to the next
segment.

Diff Detail

Repository
rB Blender

Simplified to only change the Copy Transforms constraint.

Alexander Gavrilov (angavrilov) retitled this revision from Use full transformation of B-Bone segments in some constraints. to Use full transformation of B-Bone segments in Copy Transforms..Aug 13 2018, 10:03 AM
Alexander Gavrilov (angavrilov) edited the summary of this revision. (Show Details)
source/blender/blenkernel/intern/constraint.c
548

I'm tempted to just include the full_bbone option as part of the flags arg, as a temporary runtime-only flag that gets set where it's needed.

For example:

constraint_target_to_mat4(ct->tar, ct->subtarget, ct->matrix, CONSTRAINT_SPACE_WORLD, ct->space, con->flag | CONSTRAINT_FLAG_BBONE_SHAPE_FULL, con->headtail);

where this flag is defined in DNA_constraint_types.h -> eBConstraint_Flags as something like:

/* use full transformation (not just segment locations) - only set at runtime  */
CONSTRAINT_FLAG_BBONE_SHAPE_FULL = (1 << 11),

The only thing I'm not sure of atm is whether it's better to use this value (paving the way for future constraints to actually just expose such values directly), or to take over something like (1 << 15) or (1 << 31), which are usually reserved for the temp flags. On balance, it's probably better to use (1 << 11) then :)

The issue with adding the boolean arg as you've got it now is that it can quickly get confusing what exactly such "true" or "false" args mean when just scanning the code.

This revision was not accepted when it landed; it landed in state Needs Review.Aug 13 2018, 7:59 PM
This revision was automatically updated to reflect the committed changes.