Replace drag-point editing with Unity splines#567
Draft
freezy wants to merge 7 commits into
Draft
Conversation
Record byte-exact goldens for every drag-point geometry consumer, including surface, ramp, rubber, wire guide, trigger-outline, and light-insert output. The fixtures include vertex positions, normals, UVs, indices, and control-point metadata so later storage and editor changes cannot alter generated geometry. Exercise open and closed curves across smooth flags and accuracy levels in both two and three dimensions. A VPX export/reload matrix also compares every BIFF field for all six Unity-backed item types, separating serialized semantics from the runtime-only IDs and calculated ramp heights.
Depend on Unity Splines 2.8.2 and expose it to the runtime, editor, and test assemblies. Convert raw VPX knot positions to broken Bezier knots with tangents ported from VPE's centripetal Catmull-Rom coefficients, preserving the exact curve while keeping the source floats out of coordinate-space round trips. Store every semantic and runtime drag-point field in serializable per-knot metadata, and rebuild derived tangents after knot edits. Edit-mode tests cover bit-identical data round trips, sampled Catmull-Rom/Bezier equivalence for open and closed curves, and rejection of authored tangent changes.
Move Rubber, Trigger, Surface, MetalWireGuide, LightInsertMesh, and Ramp onto a shared child SplineContainer with index-aligned VPE metadata. Legacy arrays now upgrade lazily, while mesh, collider, packable, and VPX export consumers keep reading computed DragPointData arrays and therefore retain their existing APIs. Place spline children under the exact VPX-to-Unity basis so knot floats remain verbatim in serialized data. Centralize insert/remove metadata alignment, derived-tangent restoration, planar constraints, Undo/prefab recording, and mesh invalidation; retain Ramp's endpoint Z-to-height behavior and cover the migration with edit-mode component tests.
Route all six drag-point inspectors through Unity's spline tool context and expose VPE metadata for the selected knots. Smoothness remains VPE-authored, while slingshot and texture fields stay aligned with native knot selection. Keep the established flip, reverse, and center-origin operations, including closed-loop orientation and slingshot rotation. Draw segment ownership and knot indices over the native gizmo, and cover the subtle transforms with editor tests.
Delete the custom control-point selection, curve traveller, context menus, and scene-view renderer now that Unity Splines owns knot editing. Remove the old inspector contract and its drag-point-only handle utility as well. Keep the remaining flip-axis detail local to the spline inspector so the new editor path no longer references any part of the retired handle stack.
Greptile SummaryThis PR replaces drag-point editing with Unity spline workflows. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "splines: suppress derived tangent notifi..." | Re-trigger Greptile |
Owner
Author
|
Follow-up: tangent notifications are fixed in be7e501. Inserted points remain unlocked to preserve legacy insertion behavior; ramp calculated heights are derived again during the required mesh rebuild. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes #541.
Tests
DragPointSplineComponentTests(11 passed)RubberTests.ShouldKeepGeneratedSplinesOutOfPackageRoundTrips(passed)