Sculpting Pro APi Documentation
Sculpting Pro Utilities
Global SculptingPro utility library (3d math, geometry and mesh).
Public Methods
public static class SmoothingFilters
{
// Laplacian filter algorithm of mesh smoothing
public static class LaplacianFilterSmoothing
 {
  public static Vector3[] LaplacianFilter(Vector3[] vertices, int[] triangles, float intensity)
  // Returns smooth calculation of Laplacian method
 }

// Humphrey's [HC] filter algorithm of mesh smoothing
public static class HCFilterSmoothing
 {
  public static Vector3[] HCFilter(Vector3[] inVerts, int[] inTris, float intensity = 1)
  // Returns smooth calculation of HC Filter method
 }
}

public static class GeometryModification
{
// Geometry subdivision class
public static class VertexSubdivision
 {
  public static void Subdivide(Mesh mesh)
  // Main subdivision method - increases count of vertices on the mesh
 }

public static int[] FlipMesh(int[] tris)
// Mesh flip method by reversing triangles

public static Vector3[] TryCloseSeams(Vector3[] vertices, float lookingDistance = 0.01f, bool viaThread = false)
// Try to close open seams by specific vertices & distance

public static bool CombineChildren(MeshFilter entry, SculptingPro_Model model = null)
// Combine roots mesh with its children - creates single object with all its submeshes

public static Vector3[] StampHeightmap(HeightmapAttributes ha, List<HeightmapPixelData> hpd)
// Stamp any heightmap texture onto specific mesh (HeightmapPixelData list required) [Thread-safe]

public static List<HeightmapPixelData> CalculateHeightmapPixelData(Texture2D heightmapTexture, bool inverseHeightmap = false)
// Heightmap pixel data calculation - generate vertex lightness for each pixel of the selected heightmap texture (Main-thread only)

// Alternative normal recalculation based on threshold and angles
public static class AlternativeNormals
 {
  public static void RecalculateNormals(Mesh mesh, float angle = 90)
  // Recalculate the normals in alternative way - requires specific angle and threshold. 90 degrees is a default, smooth value. Use 0 degrees for flat smoothing.
  
  public static Vector3[] RecalculateNormals(NormalData nd, float angle = 90)
  // Recalculate the normals in alternative way - requires specific angle and threshold. 90 degrees is a default, smooth value. Use 0 degrees for flat smoothing.
 }
}

public static class MeshReference
{
public static Mesh CreateNewMeshReference(Mesh entryMesh, bool recalculateBounds = true, bool recalculateNormals = true, bool recalculateTangents = true)
// Create a brand new mesh reference copy

public static void CreateNewMeshReference(MeshFilter entryMeshFilter, bool recalculateBounds = true, bool recalculateNormals = true, bool recalculateTangents = true)
// Create a brand new mesh reference, does some additional work (if the shared mesh exists)

public static Shader GetProperPipelineDefaultShader(bool lit = true, string standardUnlitCustomKeyword = "")
// Returns a proper pipeline default shader - URP returns URP/Unlit etc
}

public static class Transformations
{
public static Vector3 TransformPoint(Vector3 WorldPos, Quaternion WorldRot, Vector3 WorldScale, Vector3 Point)

public static Vector3 TransformPoint(SculptingPro_Thread.SculptingInputData.TransformModelData m, Vector3 Point)

public static Vector3 TransformPointInverse(Vector3 WorldPos, Quaternion WorldRot, Vector3 WorldScale, Vector3 Point)

public static Vector3 TransformPointInverse(SculptingPro_Thread.SculptingInputData.TransformModelData m, Vector3 Point)

public static Vector3 TransformDirection(SculptingPro_Thread.SculptingInputData.TransformModelData m, Vector3 Point)
}

public static class Math3D
{
public static double GetRandomNumber(double minimum, double maximum)
// Returns random number between minimum & maximum

public static Vector3 CustomLerp(Vector3 a, Vector3 b, float t)
// Custom linear interpolation between A to B
}