Vixen
02b45cc4
csharp
public static class ProxyShapeCache

Pairs a loaded shape set with a rig, once.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The same join AnimationClipCache does for a clip, and it was missing for the same reason it was missing there. ProxyShapeSetContent names joints and does not know which skeleton will have them; ProxyShapeSet is the resolved form with every shape bound to a joint index. Somebody has to do that resolution, and doing it per character is how thirty copies of one enemy come to hold thirty identical shape sets.

⚠ An empty set is an answer and not a failure. A body with no shapes is legitimate, and so is one whose shapes all name joints this rig does not have — the second is a mistake, but it is a mistake the unresolved list reports rather than one a null return would. Retrying a bad bake every frame would turn one authoring mistake into a per-frame allocation, so the empty answer is cached like any other.

⚠ Unresolved shape names are collected on the first bake and kept. A caller that asks a second time is answered from the cache and would otherwise see an empty list — which reads as "nothing was wrong" rather than "somebody already asked".

Methods (2)

  • public static ProxyShapeSet Get(ProxyShapeSetContent content, Skeleton skeleton, ICollection<string>? unresolved = null)

    The shape set for a content and a rig, baking it the first time it is asked for.

  • public static bool Forget(ProxyShapeSetContent content)

    Forgets every bake of a content, for a rig that has been rebuilt underneath it.

Used by (1)

  • LoadPathTestsVixen.Animation.Tests