Documentation

Unity Engine

Download Unity

Unity Engine

Create(AvatarMask, Allocator)

Create WeightMaskBuilder from an AvatarMask asset.
Read time 1 minuteLast updated 4 hours ago

Definition

[ExcludeFromBurstCompatTesting("Takes managed AvatarMask")]public static WeightMaskBuilder Create(AvatarMask avatarMask, Allocator allocator)

Parameters

avatarMask

AvatarMask asset.

allocator

Allocator used for WeightMaskBuilder. Allocator is a member of the <a href="https://docs.unity3d.com/ScriptReference/Unity.Collections.Allocator.html"&gt;Unity.Collections.Allocator&lt;/a> enumeration.

Returns

Type

Description

WeightMaskBuilderReturns 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.