Skip to content

Commit 4252b75

Browse files
author
Unity Technologies
committed
com.unity.splines@2.7.1
## [2.7.1] - 2024-10-17 ### Added - [STO-3204] Added a **Create Spline** button to enter spline creation when you do not have the Spline tool context activated. - New `SplineExtrude` and `SplineMesh` option enables new extrusion profiles, including `Circle`, `Square`, `Road`, and `Spline`. - Added a section in the documentation for the `Source Spline Container` in the `SplineExtrude` component. ### Bug Fixes - [SPLB-292] Removed the dependency on the UGUI package. - Removed the toggle to override the target spline in the `SplineExtrude` inspector. - [SPLB-288] Fixed a bug where a prefab `SplineContainer` would unexpectedly restore splines deleted before entering and exiting playmode. - [SPLB-284] Fixed a bug that prevented baking instances of multiple `SplineInstantiate` components when multi-selecting. - [SPLB-277] Fixed a bug where instantiating a prefab with `SplineAnimate` component would throw messages in the console. - [SPLB-279] Fixed a bug where closing a Spline would not update the auto-smooth knots at the extremities.
1 parent 63649e7 commit 4252b75

35 files changed

+3272
-55325
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ All notable changes to this package will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [2.7.1] - 2024-10-17
9+
10+
### Added
11+
12+
- [STO-3204] Added a **Create Spline** button to enter spline creation when you do not have the Spline tool context activated.
13+
- New `SplineExtrude` and `SplineMesh` option enables new extrusion profiles, including `Circle`, `Square`, `Road`, and `Spline`.
14+
- Added a section in the documentation for the `Source Spline Container` in the `SplineExtrude` component.
15+
16+
### Bug Fixes
17+
18+
- [SPLB-292] Removed the dependency on the UGUI package.
19+
- Removed the toggle to override the target spline in the `SplineExtrude` inspector.
20+
- [SPLB-288] Fixed a bug where a prefab `SplineContainer` would unexpectedly restore splines deleted before entering and exiting playmode.
21+
- [SPLB-284] Fixed a bug that prevented baking instances of multiple `SplineInstantiate` components when multi-selecting.
22+
- [SPLB-277] Fixed a bug where instantiating a prefab with `SplineAnimate` component would throw messages in the console.
23+
- [SPLB-279] Fixed a bug where closing a Spline would not update the auto-smooth knots at the extremities.
24+
825
## [2.6.1] - 2024-05-23
926

1027
### Bug Fixes

Documentation~/TableOfContents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* [Configure the movement of a GameObject](animate-movement.md)
1818
* [Spline Animate component reference](animate-component.md)
1919
* [Extrude a mesh along a spline](extrude.md)
20-
* [Create a tube-shaped mesh along a spline](extrude-mesh.md)
20+
* [Create a 3D mesh along a spline](extrude-mesh.md)
2121
* [Spline Extrude component reference](extrude-component.md)
2222
* [Spline Element Inspector overlay reference](element-inspector.md)
2323
* [Spline component reference](spline-component.md)

Documentation~/create-a-spline.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,28 @@
22

33
Splines are paths made up of control points called knots. Segments connect knots to other knots. You can place knots onto the surface of objects or [align them to the grid](https://docs.unity3d.com/Manual/GridSnapping.html). Knots can include tangents which control the curvature of the segment at that knot.
44

5+
## Create a new spline
6+
57
To create a spline:
68

79
> [!NOTE]
810
> Before you add a knot to a spline, the spline's default location is 0, 0, 0. After you create the spline's first knot, the spline takes that knot's location.
911
1012
1. Do one of the following:
13+
* In the **Scene** view, from the **Tools** overlay, select **Create Spline**.
1114
* Go to **GameObject** > **Spline** > **Draw Splines Tool**.
1215
* In the [Hierarchy window](xref:Hierarchy), right-click and select **Spline** > **Draw Splines Tool**.
1316
1. Click in the [Scene view](xref:UsingTheSceneView) to create knots for the spline's path to follow. If you want to add a curve to the knot's segment, click and drag to create a knot with tangents.
1417

1518
> [!TIP]
1619
> When you use the Draw Splines Tool, if you click on the surface of a GameObject, the knot snaps to that surface. Otherwise, the knot snaps to the grid.
17-
1. To exit the **Draw Splines Tool**, select a tool in the Tools overlay or press Escape.
20+
1. To exit the **Draw Splines Tool**, select a tool in the **Tools** overlay or press Escape.
21+
22+
## Add to an existing spline container
23+
24+
To add a spline to a GameObject's existing spline container:
25+
26+
1. In the **Scene** view, select your spline GameObject.
27+
1. From the **Tools** overlay, select the **Spline** context.
28+
1. From the **Tools** overlay, select **Create Spline**.
29+
1. Create a new spline. It's added to the existing spline container as a new spline. You can attach it to a knot in the existing spline, or leave it disconnected.
Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,58 @@
11
# Spline Extrude component reference
22

3-
Extrude a mesh along a spline to create shapes such as wires, ropes, noodles, and tubes.
3+
Use the Spline Extrude component to customize the geometry of the mesh you extrude on a spline.
44

5-
The Spline Extrude component requires a GameObject to have a Mesh Filter and Mesh Renderer component. When you add a Spline Extrude component to a GameObject, a Mesh Filter and Mesh Renderer component are added to that GameObject.
5+
**Note:** If you add Spline Extrude to a GameObject that already has a mesh, that mesh is replaced with a new one.
66

7-
If you add Spline Extrude to a GameObject that already has a mesh, then Spline Extrude removes that mesh from the GameObject and creates a new mesh for the GameObject to use.
7+
## Source Spline Container
8+
9+
Select a GameObject that has an attached Spline component you want to extrude a mesh on.
10+
11+
You can use a Spline as a source for the extruded mesh of one or more GameObjects. Edits you make to the source Spline then update those GameObjects. For example, if you want to create a street with a sidewalk, you can create a Spline for the street, and then use the street Spline as a source for a sidewalk GameObject. Any changes you make to the street layout update the sidewalk to match.
12+
13+
## Shape Extrude
14+
15+
| **Property** | | **Description** |
16+
| --- | --- | --- |
17+
| **Type** > **Circle**| | Create a shape with a round cross-section. |
18+
| | **Circle Settings** > **Sides**| Increase to create a smoother surface. The minimum value is `2`. |
19+
| **Type** > **Square** | | Create a shape with a square cross-section. |
20+
| **Type** > **Road** | | Create a shape with a flat cross-section and a slight lip. |
21+
| **Type** > **Spline Profile** | | Use a different spline as a template for the current spline. |
22+
| | **Spline Profile Settings** > **Template** | Select the spline container you want to use as a template. |
23+
| | **Spline Profile Settings** > **Spline Index** | If the template container has more than one spline, select the spline you want.|
24+
| | **Spline Profile Settings** > **Side Count** | Increase to create a smoother surface. The minimum value is `2`. |
25+
| | **Spline Profile Settings** > **Axis** | Which of the template spline axes to follow when drawing this spline. |
26+
27+
28+
## Geometry
29+
30+
| **Property** | **Description** |
31+
| --- | --- |
32+
| **Auto Refresh Generation** | Allow the mesh to update at runtime if the spline changes. |
33+
| **Frequency** | How many times a second to refresh the mesh. |
34+
| **Radius** | Width of the extrusion, measured from the spline path. |
35+
| **Segments Per Unit** | Increase the value to create smoother curves. |
36+
| **Cap Ends** | Fill the ends of an open-ended mesh. |
37+
| **Flip Normals** | Reveal the inside of the 3D shape. |
38+
39+
## Advanced
40+
41+
| **Property** | **Description** |
42+
| --- | --- |
43+
| **Range** | To extrude only some of the spline, define a range. `0` is the first spline point, and `100` is the last one. |
44+
| **Percentage** | Another way to control the **Range**. |
45+
| **Update Colliders** | If the spline has a collider, update the collider to match the 3D shape as you change the extrusion properties. |
846

9-
Use the Spline Extrude component to customize the geometry of the mesh you extrude on the spline.
10-
1147

12-
| **Property** | **Description** |
13-
| :-------------------- | :------------------------ |
14-
| **Spline** | Select a GameObject that has an attached Spline component you want to extrude a mesh on. |
15-
| **Create Mesh Asset** | Create a new mesh asset to attach to this GameObject. </br> This property is visible only if you haven't selected a mesh for the GameObject the Spline Extrude is attached to. |
16-
| **Radius** | Set the radius of the extruded mesh. |
17-
| **Profile Edges** | Set the number of sides that the radius of the mesh has. The minimum value is 3. |
18-
| **Segments Per Unit** | Set how many edge loops make up the length of one unit of the mesh. |
19-
| **Cap Ends** | Enable to fill each end of the mesh. If the spline the mesh is extruded on is closed, then this setting has no effect. |
20-
| **Range** | Select the section of the spline to extrude the mesh on. |
21-
| **Percentage** | Set a percentage of the spline to extrude the mesh on. |
22-
| **Auto-Regen Geometry** | Enable to regenerate the extruded mesh when the target spline is modified at runtime or in the Editor. If you don't want the Spline Extrude component to regenerate the extruded mesh at runtime when the target spline is modified, disable **Auto-Regen Geometry**. |
23-
| **Rebuild Frequency** | Set the maximum number of times per second that mesh regenerates. This property is visible only when you enable the **Auto-Regen Geometry** method.|
24-
| **Update Colliders** | Enable to automatically update any attached collider components when the mesh extrudes. |
48+
## Mesh Filter and Mesh Renderer components
49+
50+
When you add the Spline Extrude component to a GameObject, the Unity Editor adds two more components that all 3D GameObject need:
51+
52+
* [Mesh Renderer Component](https://docs.unity3d.com/Manual/class-MeshRenderer.html)
53+
* [Mesh Filter Component](https://docs.unity3d.com/Manual/class-MeshFilter.html)
2554

2655
## Additional resources
2756

28-
* [Create a tube-shaped mesh along a spline](extrude-mesh.md)
57+
* [Create a 3D mesh along a spline](extrude-mesh.md)
2958
* [Use components](xref:UsingComponents)

Documentation~/extrude-mesh.md

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
1-
# Create a tube-shaped mesh along a spline
1+
# Create a 3D mesh along a spline
22

33
Use the [Spline Extrude](extrude-component.md) component to extrude a mesh along a spline to create shapes such as tubes, wires, ropes, and noodles.
44

5-
To create a tube-shaped mesh along a spline:
5+
To create a 3D mesh along a spline:
66

7-
1. Do one of the following to create a spline:
8-
* Go to **GameObject** &gt; **Spline** &gt; **Draw Splines Tool**.
9-
* In the [Hierarchy window](xref:Hierarchy), right-click and select **Spline** &gt; **Draw Splines Tool**.
10-
1. Draw a shape for the spline:
11-
* Click in the [Scene view](xref:UsingTheSceneView) to create knots for the spline's path to follow.
12-
* To add a curve to a knot's segment, click and drag to create a knot with tangents.
13-
* To exit the **Draw Splines Tool**, select a tool in the Tools overlay or press Escape.
7+
1. [Create a spline](create-a-spline.md).
8+
1. Add the **Spline Extrude** component to the spline GameObject. This component controls the properties of the extruded mesh. To customize the properties, refer to the [Spline Extrude component reference](extrude-component.md).
9+
1. Adding a **Spline Extrude** component automatically adds a **Mesh Filter** and **Mesh Renderer** component to the GameObject. These components are necessary for all 3D GameObjects. Refer to [Mesh Renderer Component](https://docs.unity3d.com/Manual/class-MeshRenderer.html) and [Mesh Filter Component](https://docs.unity3d.com/Manual/class-MeshFilter.html) for more information.
1410

15-
> [!TIP]
16-
> You can quickly manipulate the position of knots and tangents. In the [Tools overlay](xref:overlays), set the tool context to **Spline** and make sure that **Draw Splines Tool** is disabled. Select and drag a knot or tangent to move it.
17-
18-
1. Add the **Spline Extrude** component to the GameObject that has the spline you created attached to it.
19-
1. In the **Spline Extrude** component, do the following to configure the extruded mesh:
20-
* Enter a value for the **Radius** property to set the thickness of the extruded mesh. A higher value creates a thicker mesh and lower value creates a thinner mesh.
21-
* Enter a value for the **Profile Edges** property to select how many sides the radius of the mesh has.
22-
* Enter a value for the **Segments Per Unit** property. If your spline has lot of curves, enter a high value to make the extruded mesh look smoother.
23-
* If your spline isn't closed and you want to fill in the ends of your extruded mesh, enable **Cap Ends**.
2411

2512
## Additional resources
2613

Documentation~/extrude.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Extrude a mesh along a spline
22

3-
Extrude a mesh along a spline to create shapes such as tubes, wires, ropes, and noodles.
3+
Extrude a mesh along a spline to create shapes such as tubes, wires, and roads.
44

55
To refer to a sample scene that demonstrates how the Spline Extrude component can extrude a mesh along a spline, [import the **Extrude Spline and Nearest Point** sample scene](index.md#import-splines-samples).
66

77
| **Topic** | **Description** |
88
| :-------------------- | :----------------------- |
9-
| **[Create a tube-shaped mesh along a spline](extrude-mesh.md)** | Use the Spline Extrude component to extrude a mesh along a spline. |
9+
| **[Create a 3D mesh along a spline](extrude-mesh.md)** | Use the Spline Extrude component to extrude a mesh along a spline. |
1010
| **[Spline Extrude component reference](extrude-component.md)** | Understand the properties of the Spline Extrude component. |

Editor/Components/SplineComponentEditor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class SplineComponentEditor : Editor
66
{
77
static GUIStyle s_FoldoutStyle;
8-
8+
99
internal static readonly string k_Helpbox = L10n.Tr("Instantiated Objects need a SplineContainer target to be created.");
1010

1111
protected bool Foldout(bool foldout, GUIContent content)

0 commit comments

Comments
 (0)