EasyLine - Spline Mesh Deformer
EasyLine - Spline Mesh Deformer
EasyLine - Full Documentation & User Guide
EasyLine is a professional, performance-driven tool for drawing splines and automatically deforming 3D meshes and prefabs in Unity. It is perfectly suited for creating roads, pipes, vines, race tracks, barriers, and animated conveyors.
Create an empty object in your scene (Right Click in Hierarchy → Create Empty).
Name it, e.g., "My Road".
Add the BezierSpline component to it (Add Component → Bezier Spline).
A small starting curve with 4 points will appear, but we want to draw our own!
Instead of manually moving each point, EasyLine features a dedicated Global Tool for "painting" the path directly onto your terrain!
Select the an object in the Hierarchy .
Look at the top toolbar in Unity (where you find the Move/Rotate/Scale icons). Click the EasyLine Spline Tool icon.
Aim your Scene View camera at the terrain/ground. Your cursor will highlight a reticle on the surface.
Left Click: Click to place the next segment. It automatically snaps to the surface height!
Click and Drag: Hold the left mouse button while placing a point to define the Bezier curvature (tangents) instantly.
NEW: Smart Continuation/Splitting:
Auto-Extend: Clicking near the last anchor point extends the spline.
Auto-New: Clicking far away (>20m) automatically creates a new spline object so you can start a new path without deselecting.
Insert Point: Hover over any existing line between two anchors. A green sphere will appear. Click to insert a new anchor exactly at that position.
Be sure that object has SplineMeshDeformer (Should be added auto)
Locate the Mesh Source section.
The tool offers 2 powerful Source Modes:
Mesh Mode: Drag a raw .fbx or .obj into the Source Mesh field.
If you use mesh mode you must put the material in the appropriate slots!
Prefab Mode: Check the Use Prefab option and drag your Prefab from the Project window. The script extracts the mesh while preserving materials.
4. There is also the Mixed Meshes option: Toggle the Mixed Meshes checkbox to sequence multiple different models (e.g., Road → Road with Lamp → Road with Drain) along the path.
*you can choose the forward axis if needed
*Element Specific Constraints (Layer Overrides)
When using **Mixed Meshes**, each layer can have its own set of powerful constraints. This allows you to mix rigid objects (like pillars) with deforming objects (like high-tension cables) on the same spline.
#### 🔧 Core Constraints per Element:
* **Stretch to Index Ends**: Forces the model to scale perfectly along the forward axis to fill the exact range between its Start and End indices. This is essential for modular bridge sections or pipes where gaps are unacceptable.
* **Force 100% Upright**: Ensures the object always points "World Up," ignoring any banking or twisting of the spline. Perfect for street lamps, trees, or fence posts on hills.
* **Deform Props**: By default, props are rigid. Enabling this allows individual small pieces (like a flexible segment of a railing) to bend along the curve while others remain stiff.
* **Rotation Locks (X, Y, Z)**: Freeze specific rotation axes. For example, lock **Z (Roll)** to keep a train carriage flat on a banking curve, or lock **X (Pitch)** to keep a ladder vertical.
* **Allow Box Simplification**: If global "Simplify Props as Boxes" is on, you can uncheck this for specific high-detail elements that *must* have accurate mesh collision.
#### Modeling Adjustments:
* **Position & Rotation Offsets**: Shift your model sideways, upwards, or rotate it locally without touching the original asset.
* **Local Scale & Flip**: Quickly resize or flip the mesh on X, Y, or Z axes.
> [!NOTE]
> **Priority Logic**: Elements lower in the list override those above them if their indices overlap. This allows you to "layer" a base road and then place specialized bridge sections or decorative props exactly where needed.
Select a main Anchor point (green/red spheres).
Switch to the Scale Tool (R). Red (X) and Green (Y) handles will appear.
Pull the red axis to smoothly taper or widen the road at that specific point.
Select an Anchor point.
Switch to the Rotate Tool (E). A Cyan Ring will appear around the point showing the current Tilt.
Rotate the ring to bank the mesh. The system smoothly interpolates the twist between anchors.
Tip: Use Smooth Bend Strength in Advanced Options to keep high-speed turns smooth.
Stretch to Fit Curve: Automatically stretches the mesh to cover exactly 100% of the spline, eliminating gaps at the end.
Overlap Offset: Use this to fix models with incorrect pivots. A small negative value can close tiny gaps between segments.
Loop Curve: Perfectly closes the spline into an infinite circle (ideal for racetracks).
EasyLine includes an optimized module for moving meshes (tank tracks, factory belts, rivers).
Check Animate Conveyor in the inspector.
Set your Conveyor Speed.
Static Collider: Keeps the physical collider stationary while the visual mesh moves. This saves massive CPU overhead by avoiding constant physics rebaking.
Fast Animation Mode (LUT): Uses a pre-calculated Look-Up Table for per-vertex math, allowing hundreds of animated splines to run simultaneously on mobile or low-end hardware.
When segments join, lighting may show hard edges.
Ensure Smooth Normals is enabled in the Advanced Options tab of the SplineMeshDeformer.
The tool will automatically blend vertex normals along the entire path, even across the loop seam.
Once your path is perfect, you can "bake" it for production:
Bake To Prefab: Saves the deformed 3D model to your disk and builds a static object. This inherits all colliders and lighting and is perfect for performance.
Export To OBJ: Generates a standard .obj file of your custom path for modification in external tools like Blender or Maya.
* Spline Prefab Instantiator
Beyond simple meshes, the Instantiator allows you to scatter complex GameObjects along the spline.
Hybrid Deformation: Toggle "Deform Meshes" to make child geometry bend with the curve while keeping scripts, lights, and VFX intact.
Precise Spacing: Choose between "Total Count" or "Fixed Distance" to perfectly populate your path.
Natural Randomization: Add jitter to position, rotation, and scale to create organic-looking forests, debris, atau street props.
Preserve Geometry: A single toggle ensures your prefabs keep their exact asset scale and shape, ignoring spline-based distortions.