Blender Git Commit Log

Git Commits -> Revision fcf2a71

Revision fcf2a71 by Alexander Gavrilov (master)
September 4, 2019, 07:34 (GMT)
Armature: add Inherit Scale options to remove shear or average the scale.

As an inherent property of matrix-based transformation math, non-
uniform scaling of a parent bone induces shear into the transform
matrix of any rotated child. Such matrices cannot be cleanly
decomposed into a combination of location/rotation/scale, which
causes issues for rigging and animation tools.

Blender bones have options to exclude rotation and/or scale from the
inherited transformation, but don't have any support for removing the
often undesired shear component. That goal requires replacing simple
parenting with a combination of multiple bones and constraints. The
same is true about the goal of inheriting some scale, but completely
avoiding shear.

This patch replaces the old Inherit Scale checkbox with a enum that
supports multiple options:

* Full: inherit all effects of scale, like with enabled Inherit Scale.

* Fix Shear: removes shear from the final inherited transformation.

The cleanup math is specifically designed to preserve the main
axis of the bone, its length and total volume, and minimally
affect roll on average. It however will not prevent reappearance
of shear due to local rotation of the child or its children.

* Average: inherit uniform scale that represents the parent volume.

This is the simplest foolproof solution that will inherit some
scale without ever causing shear.

* None: completely remove scale and shear.

* None (Legacy): old disabled Inherit Scale checkbox.

This mode does not handle parent shear in any way, so the child
is likely to end up having both scale and shear. It is retained
for backward compatibility.

Since many rigging-related addons access the use_inherit_scale
property from Python, it is retained as a backward compatibility
stub that provides the old functionality.

As a side effect of reworking the code, this also fixes a matrix
multiplication order bug in the Inherit Rotation code, which caused
the parent local scale to be applied in world space. In rigger
opinion this option is useless in production rigs, so this fix
should not be a problem.

Reviewers: brecht

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

Commit Details:

Full Hash: fcf2a712eca278f198e8d61845f2078088af1f9a
Parent Commit: 64f8f7d
Lines Changed: +364, -41

14 Modified Paths:

/release/scripts/startup/bl_ui/properties_data_bone.py (+4, -2) (Diff)
/release/scripts/startup/bl_ui/space_view3d.py (+1, -1) (Diff)
/source/blender/blenkernel/BKE_armature.h (+1, -0) (Diff)
/source/blender/blenkernel/intern/armature.c (+80, -24) (Diff)
/source/blender/blenlib/BLI_math_matrix.h (+6, -0) (Diff)
/source/blender/blenlib/intern/math_matrix.c (+126, -0) (Diff)
/source/blender/blenloader/intern/versioning_280.c (+19, -0) (Diff)
/source/blender/editors/armature/armature_edit.c (+4, -2) (Diff)
/source/blender/editors/armature/armature_utils.c (+2, -0) (Diff)
/source/blender/editors/armature/pose_transform.c (+24, -8) (Diff)
/source/blender/editors/include/ED_armature.h (+1, -0) (Diff)
/source/blender/makesdna/DNA_armature_types.h (+19, -0) (Diff)
/source/blender/makesrna/intern/rna_armature.c (+74, -2) (Diff)
/source/blender/makesrna/intern/rna_armature_api.c (+3, -2) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021