internal void Copy(AvatarMask other) { for (int i = 0; i < this.humanoidBodyPartCount; i++) { this.SetHumanoidBodyPartActive(i, other.GetHumanoidBodyPartActive(i)); } this.transformCount = other.transformCount; for (int j = 0; j < other.transformCount; j++) { this.SetTransformPath(j, other.GetTransformPath(j)); this.SetTransformActive(j, other.GetTransformActive(j)); } }
internal void Copy(AvatarMask other) { for (AvatarMaskBodyPart avatarMaskBodyPart = AvatarMaskBodyPart.Root; avatarMaskBodyPart < AvatarMaskBodyPart.LastBodyPart; avatarMaskBodyPart++) { this.SetHumanoidBodyPartActive(avatarMaskBodyPart, other.GetHumanoidBodyPartActive(avatarMaskBodyPart)); } this.transformCount = other.transformCount; for (int i = 0; i < other.transformCount; i++) { this.SetTransformPath(i, other.GetTransformPath(i)); this.SetTransformActive(i, other.GetTransformActive(i)); } }
internal void Copy(AvatarMask other) { for (AvatarMaskBodyPart part = AvatarMaskBodyPart.Root; part < AvatarMaskBodyPart.LastBodyPart; part += 1) { this.SetHumanoidBodyPartActive(part, other.GetHumanoidBodyPartActive(part)); } this.transformCount = other.transformCount; for (int i = 0; i < other.transformCount; i++) { this.SetTransformPath(i, other.GetTransformPath(i)); this.SetTransformActive(i, other.GetTransformActive(i)); } }
internal void Copy(AvatarMask other) { for (AvatarMaskBodyPart index = AvatarMaskBodyPart.Root; index < AvatarMaskBodyPart.LastBodyPart; ++index) { this.SetHumanoidBodyPartActive(index, other.GetHumanoidBodyPartActive(index)); } this.transformCount = other.transformCount; for (int index = 0; index < other.transformCount; ++index) { this.SetTransformPath(index, other.GetTransformPath(index)); this.SetTransformActive(index, other.GetTransformActive(index)); } }
/// <summary> /// <para>Copy the mask settings from an AvatarMask to the clip configuration.</para> /// </summary> /// <param name="mask">AvatarMask from which the mask settings will be imported.</param> 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; } }
public void MaskToClip(AvatarMask mask) { SerializedProperty property = this.Get("bodyMask"); if ((property != null) && property.isArray) { for (AvatarMaskBodyPart part = AvatarMaskBodyPart.Root; part < AvatarMaskBodyPart.LastBodyPart; part += 1) { if (part >= property.arraySize) { property.InsertArrayElementAtIndex((int) part); } property.GetArrayElementAtIndex((int) part).intValue = !mask.GetHumanoidBodyPartActive(part) ? 0 : 1; } } SerializedProperty serializedProperty = this.Get("transformMask"); ModelImporter.UpdateTransformMask(mask, serializedProperty); }
public void MaskToClip(AvatarMask mask) { SerializedProperty serializedProperty1 = this.Get("bodyMask"); if (serializedProperty1 != null && serializedProperty1.isArray) { for (AvatarMaskBodyPart index = AvatarMaskBodyPart.Root; index < AvatarMaskBodyPart.LastBodyPart; ++index) { if (index >= (AvatarMaskBodyPart) serializedProperty1.arraySize) serializedProperty1.InsertArrayElementAtIndex((int) index); serializedProperty1.GetArrayElementAtIndex((int) index).intValue = !mask.GetHumanoidBodyPartActive(index) ? 0 : 1; } } SerializedProperty serializedProperty2 = this.Get("transformMask"); ModelImporter.UpdateTransformMask(mask, serializedProperty2); }
internal void Copy(AvatarMask other) { for (AvatarMaskBodyPart index = AvatarMaskBodyPart.Root; index < AvatarMaskBodyPart.LastBodyPart; ++index) this.SetHumanoidBodyPartActive(index, other.GetHumanoidBodyPartActive(index)); this.transformCount = other.transformCount; for (int index = 0; index < other.transformCount; ++index) { this.SetTransformPath(index, other.GetTransformPath(index)); this.SetTransformActive(index, other.GetTransformActive(index)); } }
public void MaskToClip(AvatarMask mask) { SerializedProperty property = this.Get("bodyMask"); if ((property != null) && property.isArray) { for (int i = 0; i < mask.humanoidBodyPartCount; i++) { if (i >= property.arraySize) { property.InsertArrayElementAtIndex(i); } property.GetArrayElementAtIndex(i).intValue = !mask.GetHumanoidBodyPartActive(i) ? 0 : 1; } } SerializedProperty serializedProperty = this.Get("transformMask"); ModelImporter.UpdateTransformMask(mask, serializedProperty); }