Skip to content

Bugfix: Fix Anim Tree blending inconsistency

Rafał Mikrut requested to merge github/fork/marstaik/fix_anim_tree into master

Created by: marstaik

Reduz had done some work on this to make it a "nicer" blend, but the logic is non-linear and non-deterministic.

In the old blending method, there is a rot_blend_accum that gets increased for each blend, and then the blend percentage is divided over the maximum.

This leads to non-linear scaling that is non-deterministic, since the order of the blends makes the blend weights different.

IE: Blend 1 : 0.4 percent Blend 2: 0.5 percent Blend 3: 0.1 percent -> (0.4/0.4 * rotation) * (0.5 / 0.9 * rotation) * ( 0.1 / 1.0 * rotation)

If you change the order: Blend 3: 0.1 Blend 1: 0.4 Blend 2: 0.5 -> (0.1/0.1 * rotation) * (0.4 / 0.5 * rotation) * (0.5 / 1.0 * rotation) ...Which is inconsistent for the reasons above

This change also causes the triangles in blend spaces to jump dramatically between two zones, as you would go from blending triangle A into triangle B (where Blend 2 & 3 are the common edge between the triangles): Blend 1: 0.1 Blend 2: 0.5 Blend 3: 0.4 -> Blend 2: 0.5 Blend 3: 0.4 Blend 4: 0.1

Strangely enough, the root motion code above it actually calculates all of the transforms correctly.

Merge request reports

Loading