I’m having considerable problems using Splines, Nodes and nested prefabs together. (All the following applies only to EditMode, in pretty much any Version over the past year or so… but specifically today in Unity 2019.4.17f1 with Dreamteck Splines 2.07)
I am unable to reliably apply Overrides on a SplineComputer to the outermost Prefab it is part of (e.g. via context menu > Modified Component > Apply as Override in Prefab ‘somePrefab’. Usually the overrides are superficially applied, but on scene reload they get reverted back to their previous prefab values (likely due to the attached nodes updating the Spline on Awake or OnEnable. Same problem occurs when applying all overrides on the entire outermost prefab that includes the spline-attached Node transforms. (Would be nice if it were possible to define either the spline or the nodes to drive position, rather than both racing against each other)
When applying prefab overrides via script (PrefabUtility), Nodes sometimes loose their spline connections. Also sometimes the SplineComputer in the Prefab that the overrides were applied to becomes complete Garbage (possibly due to Node-Transform updates and SplineComputer Overrides fighting each other.
When using B-Splines I get frequent “Look rotation viewing vector is zero” notifications (on average 40k of them per Spline) on asset deserialization (scene load, prefab mode, …), making the editor unusable due to 20-40 sec lag each time.
SplineMesh often tries to create a mesh that has > 65k vertices on Awake, usually extending from the actually intended Spline location, lets say at (0, 500, 1000) to (0,0,0). Othertimes Splines display as random spaghetti, no matter which Update Method is used, requiring each one of them to be manually selected to trigger an update.
SplineMesh ClipRanges of zero length cause exceptions when updated via script with manual and automatic rebuild when also switching the SplineComputer during the same Frame/Update. Possibly due to a copy of SplineSamples from the old spline being used to calculate things for the new one.
There is no visual property override cue on spline-components that are part of a prefab.
- Can Dreamteck Splines actually be used with nested prefabs?
- Is there a recommended way of working with (nested) prefabs. Are there best practices / dos / don’ts / gotchas?
I feel like in the time I have wasted on fixing/understanding the issues above i could have implemented the features I actually need from scratch.
So far this library/asset was extremely frustrating to use together with prefabs.
EDIT (workaround):
Sometimes wrtiting it all down triggers an epiphany (sort of)…
Properties on prefab instances that have been modified by a script without using UnityEditor.SerializedObject or UnityEditor.SeriealizedProperty (i.e. the SplineComputer when updated by a change to a Node transform) will not set the dirty flag for the affected components. Therefore manually calling
PrefabUtility.RecordPrefabInstancePropertyModifications(objects) on the affected objects (SplineComputer/SplineUser) followed by a scene save or PrefabUtility.
ApplyObjectOverride(object, prefabAsset) will actually apply the modifcations to the prefab asset.