Dreamteck Splines - Powerful and Flexible Spline Solution

Hey Dreamteck, I was trying to use Spline projector so that I could obtain the result.percent value for my project. However, it turns out Spline projector does not work well with the new M1 macs. It causes unity editor to hang for a couple of seconds, and the scene view window becomes black. Using Spline follower and enabling the “project” option yields the same result. Attached an SS to show you the black window. Hope you will be able to look into this.

Meanwhile, have you any other way for me to obtain a percent value of a particular gameobject along the spline without using the spline projector component?

Just encountered yet another bug that occurs on the M1 mac. Provided repro steps below:
1)Create new gameobject and add spline follower component
2)Disable “follow” option on the spline follower component
3)Ensure said gameobject (with added spline follower component) is selected
4)Attempt to zoom in and/or out in Scene view using the mouse’s scroll wheel
5)Observe Unity editor freeze
Note: Unity editor does not freeze if “follow” option is enabled

Hiya, quick question:

Is there any way to use 32bit indices for meshes to bypass the 64k vertex limit?

I tried doing this for my path generator but still hitting the 64k limit error:

spline.gameObject.GetComponent<MeshFilter>().sharedMesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;

Thanks for making this, it’s a great product!

Currently this is not supported by the Object Controller but will be added as a feature in future versions since there is already popular demand for this. You can however do this using code fairly easily:

SplineSample sample = spline.Evaluate(clipFrom);
Instantiate(prefab, sample.position, sample.rotation);
for(int i = 0; i < spawnCount-1; i ++){
double newPercent = spline.Travel(sample.percent, distanceBetweenObjects, Spline.Direction.Forward);
spline.Evaluate(sample, newPercent);
Instantiate(prefab, sample.position, sample.rotation);
}
2 Likes

Thanks for using our products! Answered to your post in the Forever thread - will need the console log.

Interesting. We don’t have an M1 machine at this point but expect to have one at some point next year. I’ll look into the code to see what I can find but it’s very strange that the follow option changes anything while in edit mode.

Haven’t looked into using different int formats currently but it might be possible. Will report back when I have some data.

1 Like

Thank you so very much! I have managed to integrate this into my project successfully! Thank you for looking into the M1 Mac bugs as well.

2 Likes

Hey Dreamteck! I have been struggling with an issue with my camera being all jittery for the past few days and I hope you will be able to assist me in the matter.

Here you can see in the video, the pink player cube that the camera is following is not jittering or anything, but everything else around the player is very jittery, especially when you start looking at the surrounding water. I have tried several methods of getting the camera to follow the player’s position and rotation:

  1. Make camera a child of the player
  2. Assign a spline follower component to the camera and have it follow the spline computer
  3. Lerp and Slerp the camera’s transform component to follow the pink player’s cube transform component

None of the above methods works to reduce jitter. I am guessing because the spline component operates based on a double precision, so that doesn’t translate well to the camera’s float component?

I have also looked at one of the examples that come with the asset and I noticed a camera smooth damp rotation script that you have provided. I have also tried using that script in my project and still, the jittering issue persists. Could I have missed setting up the spline asset correctly? I have attached SS of my spline computer and spline follower component. Thank you for helping me!

EDIT: I have also experimented with trying to reduce/increase the spline computer’s sample rate, as well as experimenting with the 3 spline follower’s update method (update, lateupdate and fixed update with rigidbody)

I’ve been looking at the video for a while but I just can’t see any jittering at all. Could it be that because you are filming at a lower framerate, the video ends up looking smooth and frames where that jittering happens are skipped?

Can you describe the jittering effect you are getting?

Hmmmmm, I am looking at the video I have posted and I am still seeing the jittery effect in the video. So the jittering effect I am noticing is that if I do not look at the pink player cube, and look further into the distance or to the sides of the spline mesh, I see that the camera’s movement is very choppy. The camera’s movement appears to be stopping and moving repeatedly to me. (0.03s to 0.05s of the video seems to be very apparent to me where the camera’s movement is very choppy)

One thing I have also noticed is that in a built-in-render pipeline project, the camera’s movement appear to be a lot smoother:

https://www.youtube.com/watch?v=UN4ZqVnbsX4

Do you think that the camera’s movement in this brp project is a lot smoother than the previously attached video (previously attached video is running in urp)? Mayhaps when comparing the two videos, you would be able to see what I am referring to?

EDIT: Hey dreamteck, I’ve managed to ask a couple of my mates to help check out the video and they don’t see any jitter in either of my videos as well. I suppose I might be too tired, and I suppose you can ignore this jittering effect I am talking about. I shall be closing this issue. Thank you very much for helping nonetheless! Cheers!

Is it possible to conform a spline to a terrain? or to a mesh.
( project the spline from the top to a mesh and conform to the mesh )

Looking at the second video, I think there is indeed something going on there. The second video looks a bit smoother but if all that you have done is switch to a different rendering pipeline, then I don’t think this is a spline related issue at all.

There are some tools that allow you to conform points to collision surfaces. For example, you can use the move tool and toggle Move on surface and then move each point to snap it along a surface. You can also use the surface creation mode for creating new points but currently, there isn’t a tool that will allow you to project an entire spline onto a surface unless you write your own code for that.

Yes you are right indeed, thank you very much for helping regardless! Really loving this spline asset :slight_smile:

What was the problem in the end? Just curious.

Honestly, I still see the jittering issue. In URP, it is a lot more apparent to me, than in BRP. I haven’t been able to figure out what is causing this issue. However, since it appears that the jittering issue is not as apparent to most others as it is to me, I have decided to forgo this issue. Also, I noticed when building for android, the jittering issue persists. Yet when building for an iOS device, i no longer see any jitter. Though I understand iOS has vsync which might contribute to no jitter. So after enabling vsync for an android device, there is much less jitter but jitter is there nonetheless.

TLDR: couldn’t figure out what is causing this jitter issue but since it is not as apparent to most others as it is to me, have decided to forgo the issue.

Hi!

Two things:

  1. I have a problem with Spline Mesh - trying to change a scale of a mesh inside the channel cause Unity editor to freeze. Using Unity 2019.4.15f1 and latest dreamteck splines available from asset store. UPDATE: It happens, if you set Scale X to zero (and it happens when you start typing 0.5 for example, replacing current value with 0)

  2. What would be the best way to “endlessly” extend a spline in the runtime? Add more points to the existing one, or spawn new computer and attach it to previous using node?

Hi, Great asset, thanks for your effort.
Im using Splines on an arFoundation app, I need to move a spline on runtime (it has certain shape), so that an helicopter can travel from the ARvirtual camera position, to the center of the ar augmented object, currently i have a node per spline point, that im moving on an script, which works on the editor, but wont work on the mobile phone. Is there an extra step I need do for it to work on mobile? thanks for the help :slight_smile:

Thanks for the update. Do you think you’ll have time to look into this in the near future?

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.