Sculpting Pro APi Documentation
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()
// Reset current model and register its initial data manually

// Model Registration

public void RegisterModel(bool includeInitialData = false)
// Initialize & register current model for successful sculpting (required method to make the sculpting work properly)
public void RegisterSeams(bool includeInitialData = false)
// Register vertex seams - While manipulating with mesh, the seams might run away and the mesh may open. If the TryCloseSeams field is enabled, the vertices will try to connect with registered neighbours (Takes more performance, but much better results)

// History Management

public void RecordHistory(bool deepHistory = false, bool restore = false)
// Record current mesh state to the history list (local)
public void UndoHistory()
// Make a step back for this mesh in the history list (if possible)
public void ClearHistory()
// Clear the whole history list for this mesh

// Mesh Essentials

public void RefreshVertices()
// Force-refresh current mesh vertices
public void RecalculateBounds()
// Recalculate current mesh bounds
public void RecalculateNormals(bool forceRecalculateNormals = false)
// Recalculate current mesh normals
public void RefreshEntireMesh(bool trisGoFirst = true)
// Refresh entire mesh with triangles, uvs etc
public void RefreshMeshCollider()
// Try to update the mesh collider
public void RestoreOriginalMesh()
// Restore current mesh status to its original/initial state
public void CombineMesh()
// Combine current mesh with its children - create one single mesh (no undo)
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;

/// <summary>
/// Example custom sculpting model. Add this script to any object with MeshFilter component.
/// The script uses old legacy Input system.
/// </summary>
public class CustomSculptingModel : MonoBehaviour
{
private SculptingPro_Model thisModel;

private void Start()
 {
  // Add SP_model to this object (If there is no MeshFilter, SP_Model will notify you)
  thisModel = gameObject.AddComponent<SculptingPro_Model>();
 }

private void Update()
 {
  if (!thisModel)
   return;
  // Additional model features...
  if (Input.GetKeyDown(KeyCode.U))
   thisModel.UndoHistory();
  if (Input.GetKeyDown(KeyCode.R))
   thisModel.RestoreOriginalMesh();
 }
}