MD_MeshProEditor
Namespace: MDPackage
Essential component for general mesh processing and a bridge between Mesh Deformation modifiers.
Read more here (Online documentation slide)
Public Methods
public void MPE_UpdateMesh()
public void MPE_RecalculateMeshNormalsAndBounds()
public void MPE_ShowHideGeneratedPoints(bool activeState)
public void MPE_IgnoreRaycastForGeneratedPoints(bool ignoreRaycast)
public void MPE_CreatePointsEditor(bool bypassVertexLimit = false)
public void MPE_CreatePointsEditor(GameObject customPatternObjectReference, float sizeMultiplier = 1f, bool bypassVertexLimit = false)
public void MPE_CreatePointsEditor(Color customPointColor, float sizeMupliplier = 1f, bool bypassVertexLimit = false)
public void MPE_ClearPointsEditor()
public void MPE_CombineMeshAndCreateNewInstance()
public void MPE_CombineMeshImmediately()
public void MPE_CreateNewReference()
public void MPE_RestoreMeshToOriginal()
public void MPE_ConvertFromSkinnedToFilter()
public void MPE_SmoothMesh(float intensity = 0.5f)
public void MPE_SubdivideMesh(int Level)
Public Fields and Properties
public Action onMeshProEditorInitialized
public bool meshCreateNewReferenceAfterCopy = true;
public bool meshUpdateEveryFrame = true;
public bool meshAnimationMode = false;
public bool meshSmoothAngleNormalsRecalc = false;
public float meshNormalsSmoothAngle = 90.0f;
public bool MeshAlreadyAwake { get; }
public bool MeshBornAsSkinnedMesh { get; }
public MeshFilter MeshCachedMeshFilter { get; }
public IReadOnlyList<Transform> GeneratedMeshPoints { get; }
public Transform GeneratedPointsRootContainer { get; }
public bool HasGeneratedVerticePoints { get; }
public bool HasCustomPointPatternReference { get; }
public bool HasCustomPointPatternColor { get; }
Examples
The following paragraphs contain MeshProEditor used in a practical example. Generate mesh-vertices as gameObjects through the MeshProEditor and modify these points at runtime.
using UnityEngine;
using MDPackage;
[RequireComponent(typeof(MeshFilter))]
public class SampleScript : MonoBehaviour
{
public bool hideGeneratedPoints = true;
private MD_MeshProEditor meshProEditor;
private void Start()
{
meshProEditor = gameObject.AddComponent<MD_MeshProEditor>();
meshProEditor.MPE_CreatePointsEditor();
meshProEditor.MPE_ShowHideGeneratedPoints(!hideGeneratedPoints);
meshProEditor.meshSmoothAngleNormalsRecalc = true;
meshProEditor.meshAnimationMode = true;
}
private void Update()
{
if (meshProEditor.GeneratedMeshPoints == null || meshProEditor.GeneratedMeshPoints.Count == 0)
return;
foreach(Transform t in meshProEditor.GeneratedMeshPoints)
t.localPosition += ((Mathf.Sin(Time.time * 1.5f) * 0.5f) * Mathf.Abs(t.localPosition.y)) * Time.deltaTime * Vector3.up;
}
}