public ConfigureClipFromMask ( |
||
mask | AvatarMask from which the mask settings will be imported. | |
return | void |
public void ConfigureClipFromMask(AvatarMask mask)
{
this.m_TransformMask = new TransformMaskElement[mask.transformCount];
for (int i = 0; i < mask.transformCount; i++)
{
this.m_TransformMask[i].path = mask.GetTransformPath(i);
this.m_TransformMask[i].weight = !mask.GetTransformActive(i) ? 0f : 1f;
}
this.m_BodyMask = new int[13];
for (int j = 0; j < 13; j++)
{
this.m_BodyMask[j] = !mask.GetHumanoidBodyPartActive((AvatarMaskBodyPart) j) ? 0 : 1;
}
}
/// <summary> /// <para>Creates a mask that matches the model hierarchy, and applies it to the provided ModelImporterClipAnimation.</para> /// </summary> /// <param name="clip">Clip to which the mask will be applied.</param> public void CreateDefaultMaskForClip(ModelImporterClipAnimation clip) { if (this.defaultClipAnimations.Length > 0) { AvatarMask mask = new AvatarMask(); this.defaultClipAnimations[0].ConfigureMaskFromClip(ref mask); clip.ConfigureClipFromMask(mask); Object.DestroyImmediate(mask); } else { Debug.LogError("Cannot create default mask because the current importer doesn't have any animation information"); } }