Appearance
kids.kapish.splines.vista
unity
Bridge that enables Vista's Unity Splines support automatically.
Installation
Add to your Unity project's package manifest:
json
{
"kids.kapish.splines.vista": "file:../../src/unity/kids.kapish.splines.vista"
}Editor-only. Requires Unity 6000.0+, and is only meaningful with Vista + Unity Splines installed.
Architecture
The problem
Vista's UnitySplineEvaluator and spline Path node are gated on #if VISTA_UNITY_SPLINE. Vista's own ModuleInitializer tries to set that symbol via a csc.rsp it writes into its vendor folder when it detects UnityEngine.Splines. That works, but the csc.rsp is regenerated on import and is assembly-local, so the evaluator can drop out and the usual "fix" is hand-editing Vista's files — which is then lost on the next Vista update.
The fix
Own the toggle as a global, durable project define rather than a vendor file:
defineConstraints: ["VISTA"]— the assembly compiles only in a Vista project, so it never touches non-Vista projects.- Package depends on
com.unity.splines— so by the time this package is installed, Unity Splines is guaranteed present. (SettingVISTA_UNITY_SPLINEwithout Unity Splines would make Vista's evaluator fail to compile, so this precondition matters.) [InitializeOnLoad]addsVISTA_UNITY_SPLINEto the active build target's scripting define symbols, add-only and idempotent — if it's already set it returns immediately, so it never starts a recompile loop.
A global define satisfies #if VISTA_UNITY_SPLINE in Vista's own assembly regardless of the state of Vista's csc.rsp, which is why this is more robust than the vendor mechanism.
Why a separate package
The dependency graph stays clean only if this lives on its own:
kids.kapish.splines ← kids.kapish.splines.paths (paths needs splines, not vista)
↑
kids.kapish.splines.vista (needs splines + vista — the intersection)
kids.kapish.terrains ← kids.kapish.terrains.vista (vista nodes, must not need splines)Putting the define in terrains.vista would force terrains → splines; putting it in splines.paths would force paths → vista. Neither is acceptable, hence the dedicated intersection package.
Multi-width path evaluator
PathVistaLink registers three Vista spline evaluators from a single SplineContainer. Vista discovers evaluators through SplineModuleUtilities.collectSplines — a static event raised with a queried id; each subscriber adds itself if its id matches. Vista's stock UnitySplineEvaluator is [RequireComponent(SplineContainer)] with one width and one id, so three widths would mean three spline objects. Instead this component subscribes to the collect event and answers for {id}--thin, {id}--path and {id}--wide, each backed by a lightweight ISplineEvaluator (a private RibbonEvaluator) generating ribbon geometry at its own width off the shared spline.
The ribbon layout is a faithful copy of Vista's: four triangles per segment, centre-line vertices alpha 1 and edge vertices alpha 0, normal = cross(tangent, up) (optionally flattened to horizontal), width ±half each side — so the masks are indistinguishable from a native Vista Path node fed by a stock evaluator. Widths: --path = pathWidth, --thin = thinWidth, --wide = pathWidth + 2·edgeWidth. Gated VISTA_UNITY_SPLINE && !VISTA_EXCLUDE_PRO (needs Unity Splines + Vista Pro) — the symbol this package's editor bootstrap guarantees.
File Structure
Runtime/
├── PathVistaLink.cs (+ private RibbonEvaluator : ISplineEvaluator)
└── Carrot.Splines.Vista.asmdef (defineConstraints ["VISTA_UNITY_SPLINE", "!VISTA_EXCLUDE_PRO"])
Editor/
├── VistaUnitySplineDefine.cs
└── Carrot.Splines.Vista.Editor.asmdef (Editor, defineConstraints ["VISTA"])Limitations / notes
- Add-only: it does not remove
VISTA_UNITY_SPLINEif Unity Splines is later removed. In practice UPM won't letcom.unity.splinesbe removed while this package depends on it, so the precondition holds. - Sets the symbol for the active build target. Vista's own
csc.rspstill covers its assembly across targets; this guarantees the editor sees it.
Build
Import via Unity Package Manager. Editor-only. Requires Unity 6000.0+.
Usage Guide
Bridge that enables Vista's Unity Splines support automatically.
Setup
- Have Vista and Unity Splines (
com.unity.splines) in the project. - Add
kids.kapish.splines.vistato the manifest. - Let Unity reload. On load it ensures
VISTA_UNITY_SPLINEis defined, Vista recompiles once, and the Unity Splines evaluator / spline Path node become available in Vista graphs.
There's nothing to configure and no component to add — it's a one-shot editor bootstrap.
Verifying
After the reload, check Project Settings → Player → Scripting Define Symbols contains VISTA_UNITY_SPLINE, and that Vista's Path node lists Unity Spline as an evaluator.
Notes
- No Vista? No effect. The assembly only compiles under the
VISTAdefine, so this package is inert in non-Vista projects. - Don't hand-edit Vista's
csc.rspanymore. That's the thing this package replaces; editing it was the symptom, not the fix. - Re-rolling Vista updates won't lose the define — it lives in your project settings, and this package re-asserts it on every load anyway.