Page MenuHome

Bones: implement a new Aligned Inherit Scale mode.
ClosedPublic

Authored by Alexander Gavrilov (angavrilov) on Oct 19 2019, 10:38 AM.

Details

Summary

Implement one more way of inheriting scale from the parent
bone, as an addition to the choices introduced in D5588.

This new mode inherits parent scale as if the parent and child
were not rotated relative to each other, always applying parent
X scale to child X scale and so forth. It is quite natural for connected
bone chains with coherent roll, like limbs or tentacles, falling
roughly between Average and Fix Shear in how closely the
parent scaling is followed.

Currently this can be achieved by using Inherit Scale: None plus
a Copy Scale with Offset from parent on the child; however, this
is cumbersome, and loses the distinction between true local and
inherited scale in the child's Local space.

This new mode also matches how the Before/After Original mix
modes work in the Copy Transforms constraint.

On the technical side this mode requires adding a right side
scale matrix multiplication into the Local<->Pose conversion,
in addition to the existing two left side matrices used for
location and orientation.

Diff Detail

Repository
rB Blender
Branch
inherit-scale-rotated (branched from master)
Build Status
Buildable 5608
Build 5608: arc lint + arc unit

Event Timeline

Since this is also how Copy Transforms implements its mix modes currently, the naming of this also has bearing on the naming discussion in D6092.

Use normalize_m4_ex - didn't notice it exists the first time.

Sybren A. Stüvel (sybren) requested changes to this revision.Nov 8 2019, 10:33 AM

The patch description currently reads as a very technical, and is IMO missing some higher-level information. For me to understand what's written, I need that information.

Please update the description to include:

  • a description of the current situation
  • the problem with the situation
  • how it is currently worked around, and
  • what the new functionality brings in terms of improvements.

As I also asked for D6134, do you have an example blend file to test the changes?

This revision now requires changes to proceed.Nov 8 2019, 10:33 AM

The patch description currently reads as a very technical, and is IMO missing some higher-level information. For me to understand what's written, I need that information.

Well, starting from basic background:

The Root Problem: Shear

Using non-uniform scale on a parent bone with parenting based on simple matrix multiplication creates shear on rotated children as an inherent property of the math.

Shear is evil, as it not only looks bad, but none of the features that rely on loc/rot/scale decomposition, including constraints, animation baking etc, will work properly with sheared bones.

Supporting non-uniform scale on the other hand is required in any reasonable rig due to squash and stretch. It is also usually logical to inherit scale at least in some way - it is expected that scaling the root bone of the character should scale the whole thing.

Existing Solutions

Fixing Shear: Stretch To Workaround

Most of existing rigs avoid shear in the final transform purely by using the accidental shear-removing side effect of Stretch To. I took special care to preserve it in the recent rotation mode patch, as Damped Track does not have this side effect.

However, the downside is that baking animation on such bones cannot work, because removing shear in the World space introduces reverse shear in the Local space.

Limiting Scale Inheritance

The second approach is to change how scale is inherited to a different mode that does not cause shear in the first place. Originally there were just two modes, but since recently I added more:

  1. Full - inherits scale fully and causes shear.
  2. Fix Shear (new) - inherits scale fully, and then removes shear in the rest position of the child bone. Local rotation still causes shear.

    This mode can be used in a complex setup to extract the best unsheared approximation of the true scale for the base of a rotated sub-rig. Then it can be further handled from other bones that don't inherit scale via constraints.
  1. Average (new) - inherits average uniform scale, and does not cause shear.

    This is the simplest way to inherit scale without shear - it fully inherits the change in volume, but removes squash & stretch effects.
  1. None - doesn't inherit scale at all.

Some other software like Maya also has options to disable scale inheritance, although they probably don't work exactly like the ones in Blender. I.e. this is a recognized problem, but there is no ideal universally agreed upon solution.

New Inherit Scale Mode (this patch)

For consistent roll bone chains like tentacles, there is another possible and meaningful mode in between Average and Full: inherit scale ignoring rotation, so parent X scale always applies to child X scale etc.

This can already be achieved by using None and adding a Copy Scale with Offset from parent to each child, but it is complicated, and messes up the Local space - it doesn't know which scale is actually local, and which is inherited.

Just saw that commit and I think it's great having more flexibility in regular parenting. This last possibility you mention (inheritance of individual scale values) sounds good as an alternative to setting up copyscale constraints on a long bone chain, and average sounds like it might just be better as default, imho, but I'm hesitant on that tbh - like you say, any rigger should know that decomposition, even that fancy polar one attempted on sheared bones won't really work in any predictable/desirable way, which is why (afaik) non-uniform scaling on a (simply parented) chain is usually either prohibited by the rigger or not attempted by the animator, so... All in all this sounds like a good, thought-through change to me.

has the advantage that it would be properly tracked in the Local vs Pose space

Do you mean the inherited scale of the child bone would become its local scale ? If so that's actually better than setting up copyscale constraint because it saves having to create children of every bone in that chain for subsequent constraining/misc use
I fear parenting options become too complicated but I guess it's a matter of getting used to

For reference, another software has an option to disable bone scale inheritance altogether, checked by default. If unchecked, non-uniform scaling results in sharing just like Blender did it until now.

As I also asked for D6134, do you have an example blend file to test the changes?

Well, here's a file. Changing the Inherit Scale setting of the selected bone to Aligned should make it appear like the middle top one (which emulates the behavior with a constraint as described above).

This revision is now accepted and ready to land.Thu, Nov 21, 3:02 PM