Unity Spline Editor is an open-source tool for creating and managing cubic bezier curves in Unity Editor.
The tool was written to bring cubic bezier splines to Unity. The tool let you do the basic operations like adding, removing or splitting curves but also provides you with options to factor, simplify, draw or cast splines to camera view. You can also adjust how splines are displayed in the editor through settings window.
- Separate tools window for Spline Editor
- Creating and managing cubic bezier splines in Scene View
- Four modes for control points: Free, Aligned, Mirrored and Automatic
- Splitting curves by split point value
- Quick factoring and simplifying splines
- Normals editor
- Casting splines to either self, custom transform or camera using Physics Raycast
- Casting control points to current mouse position using Physics Raycast
- Drawer tool for drawing splines in Scene View
- Three buttons layouts types: Image, Text and Image & Text
- Adjustable editor settings (colors, sizes etc.)
- Adjustable shortcuts through Unity Shortcuts manager
- Example scripts for generating meshes from splines and using line renderers
Unity 2020.1 or newer.
- The package is available in Unity Package Manager via git URL. Follow up this Unity page for detailed instructions. Git URL:
https://github.com/vvrvvd/Unity-Spline-Editor.git#upm
- You can also install Spline Editor by simply downloading repository zip file and copying Assets folder content to your Unity project.
Editor window can be opened by going to Window->Spline Editor
on the Unity toolbar. Spline can be edited by adding, removing or splitting curves. Additionaly every control point has four modes that can influence a neighbour control point. When spline is looped the first and the last points are treated as the same point so they share the same position and mode (keep in mind that they are still two distinct points). Splines can also be quickly factored or simplified by adding or removing mid points from them.
Spline points have normals that can be rotated along spline tangents. There is an option to flip normals or rotate all the normals by global angle.
Drawer tool lets you freely draw spline in the scene view. Use additional parameters like smoothing acute angles or segment length to adjust the tool to your needs.
Settings can be accessed by going to Edit->Project Settings->Spline Editor
on the Unity toolbar or by clicking on a gear icon in the right corner of Spline Editor window.
Add Spline Mesh component on scene to generate mesh from Bezier Spline.
It is located in Samples/Mesh Generator
folder.
To visualize spline using Line Renderer, add Line Renderer Spline component on scene.
It is located in Samples/Line Renderer
folder.