WeightedMaskLayerList Class

Summary

A replacement for the default UnityEngine.Animations.AnimationLayerMixerPlayable which uses custom Animancer.WeightedMaskLayerList.BoneWeights for each individual bone instead of just using an UnityEngine.AvatarMask to include or exclude them entirely.
Assembly
Animancer.dll
Namespace
Animancer
Interfaces
Base Types
graph BT Type-->Base0["AnimancerLayerList"] click Base0 "/animancer/api/Animancer/AnimancerLayerList" Base0-->Base1["Object"] Type-.->Interface0["IEnumerable<AnimancerLayer>"] Type-.->Interface1["IAnimationClipCollection"] click Interface1 "/animancer/api/Animancer/IAnimationClipCollection" Type-.->Interface2["IDisposable"] Type["WeightedMaskLayerList"] class Type type-node

Syntax

public class WeightedMaskLayerList : AnimancerLayerList, IEnumerable<AnimancerLayer>, 
    IAnimationClipCollection, IDisposable

Remarks

This system currently only supports 2 layers (Base + 1). Adding support for more would require additional Animancer.WeightedMaskLayerList.BoneWeights for each additional layer and modifications to Animancer.WeightedMaskMixerJob to iterate through each layer instead of just using the first two.

Constructors

Name Summary
WeightedMaskLayerList(AnimancerGraph, Animator) Creates a new Animancer.WeightedMaskLayerList.

Fields

Name Constant Value Summary
Bones
The objects being masked.
Graph
The Animancer.AnimancerGraph containing this list.
Inherited from AnimancerLayerList

Properties

Name Value Summary
AverageVelocity Vector3
The average velocity of the root motion of all currently playing animations, taking their current Animancer.AnimancerNode.Weight into account.
Inherited from AnimancerLayerList
BoneWeights NativeArray<float>
The blend weight of each of the Animancer.WeightedMaskLayerList.Bones.
Capacity int
[Pro-Only] The maximum number of layers that can be created before an System.ArgumentOutOfRangeException will be thrown. The initial capacity is determined by Animancer.AnimancerLayerList.DefaultCapacity.
Inherited from AnimancerLayerList
Count int
[Pro-Only] The number of layers in this list.
Inherited from AnimancerLayerList
DefaultCapacity int
[Pro-Only] The maximum number of layers that can be created before an System.ArgumentOutOfRangeException will be thrown (default 4).

Lowering this value will not affect layers that have already been created.
Inherited from AnimancerLayerList
static
Playable Playable
The UnityEngine.Playables.Playable which blends the layers.
Inherited from AnimancerLayerList
this[int] AnimancerLayer
Returns the layer at the specified index. If it didn't already exist, this method creates it.
Inherited from AnimancerLayerList

Methods

Name Value Summary
Add() AnimancerLayer
[Pro-Only] Creates and returns a new Animancer.AnimancerLayer at the end of this list.
Inherited from AnimancerLayerList
Create(Animator) WeightedMaskLayerList
Creates a new Animancer.AnimancerGraph and Animancer.WeightedMaskLayerList.
static
GatherAnimationClips(ICollection<AnimationClip>) void
[Animancer.IAnimationClipCollection] Gathers all the animations in all layers.
Inherited from AnimancerLayerList
GetEnumerator() FastEnumerator<AnimancerLayer>
Returns an enumerator that will iterate through all layers.
Inherited from AnimancerLayerList
GetLayer(int) AnimancerLayer
Returns the layer at the specified index.
Inherited from AnimancerLayerList
IndexOf(Transform) int
Returns the index of the value corresponding to the 'bone' in the Animancer.WeightedMaskLayerList.BoneWeights array.
IsAdditive(int) bool
[Pro-Only] Is the layer at the specified index is set to additive blending? Otherwise it will override lower layers.
Inherited from AnimancerLayerList
SetAdditive(int, bool) void
[Pro-Only] Sets the layer at the specified index to blend additively with earlier layers (if true) or to override them (if false). Newly created layers will override by default.
Inherited from AnimancerLayerList
SetDebugName(int, string) void
[Editor-Conditional] Sets the Inspector display name of the layer at the specified index.
Inherited from AnimancerLayerList
SetMask(int, AvatarMask) void
[Pro-Only] Sets an UnityEngine.AvatarMask to determine which bones the layer at the specified index will affect.
Inherited from AnimancerLayerList
SetMinCount(int) void
[Pro-Only] If the Animancer.AnimancerLayerList.Count is below the specified `min`, this method increases it to that value.
Inherited from AnimancerLayerList
SetMinDefaultCapacity(int) void
[Pro-Only] If the Animancer.AnimancerLayerList.DefaultCapacity is below the specified `min`, this method increases it to that value.
Inherited from AnimancerLayerList
static