Sculpting Pro Model
Essential component for sculpting-ready meshes. Apply this component to an object with MeshFilter component. Without this component, it's not possible to sculpt target mesh using the SculptingPro plugin.
Public Methods
public void ManuallyResetComponent()
public void RegisterModel(bool includeInitialData = false)
public void RegisterSeams(bool includeInitialData = false)
public void RecordHistory(bool deepHistory = false, bool restore = false)
public void UndoHistory()
public void ClearHistory()
public void RefreshVertices()
public void RecalculateBounds()
public void RecalculateNormals(bool forceRecalculateNormals = false)
public void RefreshEntireMesh(bool trisGoFirst = true)
public void RefreshMeshCollider()
public void RestoreOriginalMesh()
public void CombineMesh()
Examples
The following paragraph contains an example script which initializes a regular MeshFilter to the SculptingPro_Model component.
All you need to do for proper setup is to add the SculptingPro_Model component to the object. After adding the component, your object is ready for sculpting.
With this method you can easily create sculptable meshes at runtime.
using UnityEngine;
using SculptingPro;
public class CustomSculptingModel : MonoBehaviour
{
private SculptingPro_Model thisModel;
private void Start()
{
thisModel = gameObject.AddComponent<SculptingPro_Model>();
}
private void Update()
{
if (!thisModel)
return;
if (Input.GetKeyDown(KeyCode.U))
thisModel.UndoHistory();
if (Input.GetKeyDown(KeyCode.R))
thisModel.RestoreOriginalMesh();
}
}