This repository contains a basic proof of concept to create a Spline editing system into Stride & its Editor.
The purpose of this project examine the problems with editor integration, as of Stride version 4.3.0.2507.
Please refer to Editor Integration Issues for outstanding issues.
spline_nodes_v2.mp4
The projects are linked in the following way:
SplineTest.Windows ----> SplineTest ----> SplineTest.Splines
/
/
SplineTest.GameStudioExt ----
Note that SplineTest.GameStudioExt is only connected to SplineTest.Splines and not connected to the Windows/Game project.
This will be loaded within the Stride Editor since the editor loads all projects within the .sln file, but will not be included in the run-time output folder.
- In scene, create Entity
- Select entity -> Add component -> Splines -> Spline
While the entity is selected, the spline editor tool should (mostly) be active.
Note a current bug is that clicking within the scene may select another entity or deselect when clicking into an empty space.
Editor controls within the scene:
- Selecting a control point or tangent handle: standard left click when over a highlighted point.
- If control point & tangents are overlapping: Hold Alt to only select control points, hold Ctrl to only select tangent handles.
- To append new control points, hold Shift then left click in the scene.
- To delete a control point, you must use the component properties sidebar to remove from the list.
SplineTest.GameStudioExt- EditorModule.cs: Registers editor services within
Game.GameStartedevent. - EditorGameSplineEditorService.cs: Main coordinator of which gizmos are active when modifying a spline, and commits the data changes back to the asset when the user has finished their action.
- SplineGizmo.cs: Handles the visual of the spline, coordinates which gizmo is active when editing a control point.
- SplineControlPointGizmo.cs: Handles the visual of control point and tangent handles when editing a spline.
- EditorModule.cs: Registers editor services within
SplineTest.Splines- SplineComponent.cs: The spline properties as it appears in the editor.
- Spline.cs: The data store of the spline. Can be used independently.
- SplineEvaluator.cs: The default implementation of how to read the spline.
Splineuses this implementation as its default, but you can use implement your ownSplineEvaluatorand set it viaSpline.SplineEvaluator, or altenatively just use the evaluator directly. - LineVisualizerComponent.cs
- LineVisualizerRenderFeature.cs: Required by
LineVisualizerComponentto render the spline lines. Must be registered in the Graphics Compositor. - GizmoMarkerSetComponent.cs
- GizmoMarkerRenderFeature.cs: Required by
GizmoMarkerSetComponentto render the control points & tangent points in the editor. Must be registered in the Graphics Compositor.
- Adding control points through the property grid throws an error - Only use
Shift + Left Clickto add new control points. Ctrl/Shift/Altdoesn't get detected when scene is not in focus. You will need to click within the scene first before pressing a modifier key down.
- Aggror: Original Spline Implementation. See Github PR.