Blender Git Commit Log

Git Commits -> Revision 85ffaa5

Revision 85ffaa5 by Alexander Gavrilov
May 11, 2021, 15:57 (GMT)
Armature: add B-Bone lengthwise scaling and custom handle scaling options.

In addition to the base bone transformation itself, B-Bones have
controls that affect transformation of its segments. For rotation
the features are quite complete, allowing to both reorient the
Bezier handles via properties, and to control them using custom
handle bones. However for scaling there are two deficiencies.

First, there are only X and Y scale factors (actually X and Z,
but this is the legacy naming), while lengthwise all segments
have the same scaling. The ease option merely affects the shape
of the curve, and does not cause actual scaling.

Second, scaling can only be controlled via properties, thus
requiring up to 6 drivers per joint between B-Bones to transfer
scaling factors from the handle bone. This is very inefficient.

This patch addresses these deficiencies by adding Length scale
inputs, and providing toggles to apply custom handle local scale
channels to the now four scale-related properties. The 'Length'
name is used to avoid confusion due to the X/Y vs X/Z naming.

The two Length scale inputs control the ratio between the lengths
of the start and end segments of the bone: although for convenience
two inputs are provided, the whole chain is still uniformly scaled
to fit the curve.

A Scale Easing option is provided to multiply the easing value
by the Length scale factors to synchronize them - this produces
a natural scaling effect where both the shape of the curve and
the scale is affected.

The second issue is addressed by providing toggles for each handle
that multiply each of the X, Z, Length and Ease values by the matching
Local Scale channel of the handle bone, thus replacing trivial drivers.
The Scale Easing option has no effect on this process since it's easy
to just enable both Length and Ease buttons.

Finally, this fixes a strange behavior where the segments were not
actually scaled in the Y direction to match their actual length, thus
producing gaps or overlap depending on the shape of the curve. For
transformation the change should be very small if enough segments
are used, but this will affect the results of the Copy Transforms
and Armature constraints, so a backwards compatibility option is
provided. Newly created bones default to the new behavior.

Differential Revision: https://developer.blender.org/D9870

Commit Details:

Full Hash: 85ffaa501c6b45476b7060f332eb725cceb44742
Parent Commit: 351d135
Lines Changed: +366, -37

15 Modified Paths:

/release/scripts/startup/bl_ui/properties_data_bone.py (+35, -6) (Diff)
/source/blender/blenkernel/BKE_armature.h (+8, -4) (Diff)
/source/blender/blenkernel/intern/action.c (+6, -4) (Diff)
/source/blender/blenkernel/intern/armature.c (+130, -10) (Diff)
/source/blender/blenloader/intern/versioning_300.c (+31, -0) (Diff)
/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc (+1, -1) (Diff)
/source/blender/draw/engines/overlay/overlay_armature.c (+15, -1) (Diff)
/source/blender/editors/armature/armature_add.c (+10, -0) (Diff)
/source/blender/editors/armature/armature_intern.h (+2, -2) (Diff)
/source/blender/editors/armature/armature_utils.c (+14, -0) (Diff)
/source/blender/editors/armature/pose_transform.c (+8, -4) (Diff)
/source/blender/editors/armature/pose_utils.c (+4, -0) (Diff)
/source/blender/makesdna/DNA_action_types.h (+2, -2) (Diff)
/source/blender/makesdna/DNA_armature_types.h (+33, -2) (Diff)
/source/blender/makesrna/intern/rna_armature.c (+67, -1) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021