Namespace: MDPackage.Modifiers
Blend mesh between list of stored & captured shapes.
Read more here (Online documentation slide)
Properties
public bool EnableInterpolation { get; set; }
public float InterpolationSpeed { get; set; }
public float BlendValue { get; set; }
public Mesh[] TargetBlendShapes { get; set; }
public int TargetBlendShapeIndex { get; set; }
public bool ResetVertexStateOnChange { get; set; }
public IReadOnlyCollection<RegisteredBlendShapes> CurrentRegisteredBlendShapes { get; }
Public Methods
public void Morpher_UpdateMesh()
public void Morpher_ChangeMeshIndex(int entry)
public void Morpher_RegisterBlendShapes()
Examples
The following paragraphs contain Morpher modifier used in a practical example. Register specific morph shapes and control blending via script.
using UnityEngine;
using MDPackage.Modifiers;
[RequireComponent(typeof(MeshFilter))]
public class SampleScript : MonoBehaviour
{
[SerializeField] private Mesh[] targetMeshes;
[SerializeField] private int targetMeshIndex;
[SerializeField, Range(0f, 1f)] private float blendValue;
private MDM_Morpher morph;
private void Start()
{
morph = MD_ModifierBase.CreateModifier<MDM_Morpher>(gameObject, MD_ModifierBase.MeshReferenceType.CreateNewReference);
morph.TargetBlendShapes = targetMeshes;
morph.Morpher_RegisterBlendShapes();
}
private void Update()
{
morph.TargetBlendShapeIndex = targetMeshIndex;
morph.BlendValue = blendValue;
}
}