Create(AvatarMask, Allocator)
Create WeightMaskBuilder from an AvatarMask asset.
Read time 1 minuteLast updated 4 hours ago
Definition
- Type: Method
- Namespace: Unity.Animations
- Assembly: UnityEngine.AnimationCoreModule
[ExcludeFromBurstCompatTesting("Takes managed AvatarMask")]public static WeightMaskBuilder Create(AvatarMask avatarMask, Allocator allocator)
Parameters
AvatarMask asset.
Allocator used for WeightMaskBuilder. Allocator is a member of the <a href="https://docs.unity3d.com/ScriptReference/Unity.Collections.Allocator.html">Unity.Collections.Allocator</a> enumeration.
Returns
Type | Description |
|---|---|
| WeightMaskBuilder | Returns a WeightMaskBuilder with the transform weights of the AvatarMask. |
Remarks
Use this method to change the weight mask of an AvatarMask, for example to propagate the weight of a transform to its children or to mask generic channels. To use the weight mask of an AvatarMask as it is, read the weight mask that the AvatarMask stores with AvatarMaskExtensions.ToWeightMaskReference instead of building a new one.
The builder has the same transform masking as an AvatarMask in an Animator layer. If the AvatarMask has no transforms, WeightMaskBuilder.DefaultTransformWeight is 1 and every transform is included. Otherwise, WeightMaskBuilder.DefaultTransformWeight is 0 and each transform of the AvatarMask has its weight, without propagating it to its children. WeightMaskBuilder.DefaultGenericWeight is 1. Humanoid body parts aren't part of the weight mask.