Spline Mesher - Pro
4.Scripting
Whenever using the API, ensure you add using sc.splinemesher.pro.runtime; to include the namespace.
Accessing settings
Both the Spline Curve Mesher and Spline Fill Mesher components have a settings class instance, which in turn has various sub-class instances (eg. Distribution, Scale, Collider etc). They are laid out almost identically to how they’re presented in the inspector UI, so specific settings are straightforward to find.
You are encouraged to explore the settings instance in your IDE.

Rebuild() after you’ve finished making changes.A few helper functions are in place:
Spline Curve Mesher
SetInputMesh(Mesh mesh)AssignMaterials(Material[] materials)
Spline Fill Mesher
SetMaterial(Material material)
Manual rebuilding
Both the Spline Curve Mesher and Spline Fill Mesher components have a Rebuild() function, which will trigger a regeneration of the entire mesh. An option splineIndex argument can be passed on to rebuild for a specific spline.
This needs to be used when altering any component settings through script.
Dispose() function where you are sure the Spline Mesher is no longer needed, this clears up memory.Spline rebuild triggers
If you have the OnSplineAdded, OnSplineChanged or OnSplineRemoved rebuild triggers disabled, you’d also need to manage the spline cache manually through the respective AddCachedSpline, UpdateCachedSpline, RemoveCachedSpline functions.
This is needed to update the internal spline cache, which is used for the mesh generation. Without doing so, the mesh gets rebuild based on outdated spline data.
When creating splines procedurally
Many use cases call for creating Splines from a script. For instance building pipelines or tracing a river down a mountain.
❌ Don’t use SplineContainer.Spline = newSpline or SplineContainer.Splines = newSplineList. This will trigger the deletion of all the splines in the container and immediately trigger their creation again.
The Spline Mesher components reacts to these changes by default and destroys/recreates impactful resources. If this is done repeatedly it can lead to race conditions that can leave stray splines behind.
✅ Do: use SplineContainer.Spline.Copy(newSpline) (possibly in a loop). This merely changes the Spline, allowing a Spline Mesher to simply rebuild according to it.
Alternatively. Set splineMesherInstance.rebuildTriggers = RebuildTriggers.None; and only call its Rebuild() function once you’ve finished creating splines. The performance benefits are quite significant. See also the Performance Guidelines section.
Editor tools
The sc.splinemesher.pro.editor.SplineMesherEditor class contains a few public static functions, for use in custom tooling and pipelines:
- GenerateLODS (with overloads for specific scenes and meshers)
- GenerateLightmapUVs (with an overload for a list of meshers)
