public sealed class BlendShapeAnimationSystemCarries the blend-shape weights an animator sampled onto the component a frame draws from.
As a system
- Phase
- PreRender
- Reads
- AnimatorComponent
- Writes
- BlendShapeWeights
- Runs before
- MorphWeightSystem
Remarks
The last link of "animate a blend shape from a clip". The importer turns a morph channel into a scalar track, AnimationClip samples it, ClipMotion collects it into MorphWeights as the blend tree is evaluated — and this is what puts the answer where MorphWeightSystem will find it. Without it the whole chain is a number nothing reads.
Name to slot, through BlendShapeWeights.Shapes. A clip names a shape because a slot is not stable across a re-export, and the component is addressed by slot because that is what the scatter dispatches over. The binding between them is published by MorphWeightSystem out of what the render feature actually attached, so this system needs no renderer of its own and works the same in a test, in the editor and on a headless server.
⚠ Only the slots the animator named are written. A shape no clip mentioned keeps whatever was on the component — a value a script or an inspector set — because a clip saying nothing about a shape is not the same as it asking for zero. That distinction is the whole reason MorphWeightBuffer separates membership from value, and losing it here would make playing any clip wipe every hand-set expression on the face.
⚠ In PreRender, before MorphWeightSystem and after the animators have run. The weights are produced in Animation and consumed by that system, so this sits between them; the UpdateBeforeAttribute is what holds the second half, because the two are registered from different places — this by AnimationSystems and that by the renderer — and registration order cannot be relied on across them.
Fields and properties (3)
public int DrivenHow many entities had a weight written by the last run.
public int UnboundHow many shapes an animator asked for that the entity's mesh does not have, last run.
public SystemAccess AccessWhat this system reads and writes.
Methods (3)
public override JobHandle Update(in SystemContext context, JobHandle dependency)Runs the system.
public void Run(World world)Writes every animated entity's sampled weights onto its component.
public static int Apply(MorphWeightBuffer buffer, ReadOnlySpan<string> shapes, ref BlendShapeWeights component)Lands a buffer's weights on a component, by name.
Used by (3)
- AnimationSystemsVixen.Animation
- BlendShapeTrackTestsVixen.Animation.Tests
- AnimationWiringTestsVixen.Editor.App.Tests