Skip to content

Basewq/BasewqStrideSplineTest

Repository files navigation

Stride Spline Editor Proof of Concept

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.


Demonstration

spline_nodes_v2.mp4

Project Structure

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.


Editor usage

  • 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.

Points of Interest

  • SplineTest.GameStudioExt
    • EditorModule.cs: Registers editor services within Game.GameStarted event.
    • 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.
  • 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. Spline uses this implementation as its default, but you can use implement your own SplineEvaluator and set it via Spline.SplineEvaluator, or altenatively just use the evaluator directly.
    • LineVisualizerComponent.cs
    • LineVisualizerRenderFeature.cs: Required by LineVisualizerComponent to render the spline lines. Must be registered in the Graphics Compositor.
    • GizmoMarkerSetComponent.cs
    • GizmoMarkerRenderFeature.cs: Required by GizmoMarkerSetComponent to render the control points & tangent points in the editor. Must be registered in the Graphics Compositor.

Known issues

  • Adding control points through the property grid throws an error - Only use Shift + Left Click to add new control points.
  • Ctrl/Shift/Alt doesn't get detected when scene is not in focus. You will need to click within the scene first before pressing a modifier key down.

Credits/Thanks

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages