Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Dreamteck Splines - Powerful and Flexible Spline Solution

Discussion in 'Assets and Asset Store' started by Dreamteck, May 11, 2016.

  1. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    232
    Just came with an update, that we realised I had been very stupid on those occasions and accidentally toggled off the Gizmo's in the scene view. Turning them back on fixes it.
     
  2. HQF

    HQF

    Joined:
    Aug 28, 2015
    Posts:
    40
    Hi again! almost a year of this problem - Spline inside prefab -> make prefab variant -> start edit spline inside prefab variant in Prefab Editor (double click on prefab). And this cause huuuge performance drop in spline editor.. Because of Unity try to store all changed points + calculate differences between prefab and your prefab variant, its almost 3 fps on i7, GTX 1080 + SSD... If you make "unpack prefab completely" all became normal, but i need spline computer in prefab and just cant do this

    Example:
    2-15 is variant of prefab 0-0, and if I add new spline just in spline variant (Spline (1) with white text name in Hierarchy), for spline (1) all would be nice, but if i try to edit Spline with blue text name (that mean this one is variant of original prefab) performance just gone... And its with AutoSave off - Don't try to enable it.....

    upload_2021-3-5_10-52-52.png

    That's because of unity serialization mechanic I think and I know why this is happens but i never meet this problem with other assets. Please make something with it. Because this also dramatically increases file sizes of prefabs (and also - I know why this happens, but prefabs of spline with 2 mb? and I got 50 prefabs...

    upload_2021-3-5_10-53-6.png
     
  3. redpixelgamedev

    redpixelgamedev

    Joined:
    Dec 5, 2020
    Posts:
    3
    Hi Dreamteck! I cant find GetDistance() function on SplineProjector :( I need position like on SplinePositioner.position (Mode == Distance). How i can do that?
     
    fulgorr likes this.
  4. AdamBaileyMK

    AdamBaileyMK

    Joined:
    Mar 2, 2020
    Posts:
    1
    I've also encountered and duplicated this issue.
     
  5. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    336
    I was never able to fix this issue yet, and it's very frustrating. Imagine having a 625 sq km world populated with roads using dreamteck splines, and you get random issues where your roads are gone or all over the place, until you just click on the object. With thousands of those objects, it really is an issue.

    How exactly did you reproduce it? What does your setup look like? Maybe it could help dreamteck to fix it?
     
  6. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    437
    Hello

    Why does this warning show up?

    [Warning] Dreamteck was unable to scan Anonymously Hosted DynamicMethods Assembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null for derived classes
    FindDerivedClasses.GetAllDerivedClasses() at /Dreamteck/Utilities/Editor/FindDerivedClasses.cs:55

    FindDerivedClasses.GetAllDerivedClasses() at /Dreamteck/Utilities/Editor/FindDerivedClasses.cs:63

    SplineToolsWindow.Awake() at /Dreamteck/Splines/Editor/Tools/SplineToolsWindow.cs:27

    WindowLayout.LoadDefaultWindowPreferences()
     
  7. kneave

    kneave

    Joined:
    Aug 14, 2014
    Posts:
    17
    Hi, I'm trying to figure out how I can dynamicall create roads at runtime using c# and a data file. I'm good with the datafile side of things but I'm really struggling to get my head around how to create splines at runtime in code.

    Could anyone share an example with me please? All the tutorials are great but they are focused on editor usage rather than scripts.
     
  8. arpan018

    arpan018

    Joined:
    Nov 30, 2020
    Posts:
    4
    hello @Dreamteck,
    i have couple of followers for one path, they are lined up in 3x2 fashion and with specific distance behind manually in a level. i want to add couple of more after the last follower in the path. what should be right approach to achieve this?
     
  9. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    317
    Does Dreamteck Splines work with Unity Timelines? The ability to animate a transform along the spline using the Timeline window (in a similair way to setting 0-1 path position for the cinemachine dolly camera)? Thanks
     
  10. rise9912

    rise9912

    Joined:
    Feb 19, 2018
    Posts:
    10
    Hello! We are using your asset, and so far everything was going well except the one thing. We are generating a simple mesh by using surface generator, but it generates shapes with smooth normals, and there is no option to make mesh hard surface. Change Normals method won't help, because for generating hard surface meshes, as you know, all vertices should not be shared.
    upload_2021-5-14_15-17-8.png

    To avoid this we just duplicated points and place them closer to each other on the ref spline used for generator shape like this. But it not seems like an "elegant" solution. It would be handy to have a build-in feature for this. Thanks in advance!
    upload_2021-5-14_15-23-10.png
     
  11. rise9912

    rise9912

    Joined:
    Feb 19, 2018
    Posts:
    10
    Also for some reason toolbar buttons don't want to work at all. When clicking them, nothing happens, also points not selecting in scene when I select them in the inspector. Here at the screenshot, I clicked move button with a selected point, but move handle doesn't want to appear. Only hotkeys got them to work. It seems like a bug upload_2021-5-14_15-50-5.png
     
  12. rise9912

    rise9912

    Joined:
    Feb 19, 2018
    Posts:
    10
    Some devs in our studio also were encountered this problem, but not everyone. For other devs, these buttons work as they should. We are on 2019.4 LTS version right now
    Update:
    It seems just Unity bug. Set layout to default just solved this trouble
     
  13. rise9912

    rise9912

    Joined:
    Feb 19, 2018
    Posts:
    10
    For some reasons I can't change vertices Y offset for Surface Generator if extrude path has points with normal vector 0,1,0.
    upload_2021-5-14_18-18-4.png

    If I am changing normals to 0,-1,0 for some reasons it's starting to work, but it's not what I looking for because my character is following upside down with these settings
    upload_2021-5-14_18-17-10.png
     
  14. Ideas966

    Ideas966

    Joined:
    Jan 21, 2013
    Posts:
    6
    Hello, I am using the Dreamteck spline package to make a iOS driving game where players control a car that follows the driving path. I use the spline both to create the path that the car follows and the render the arrows that show the path for the player. 95% of the time In the editor it works great, and on my first scene it works great on my test device (iphone X) as well. However once in a while I will have a problem where the renderer suddenly stops appearing, and today as I added more levels about 100% of the time on my test device the renderer stopped appearing after about 5 seconds.

    I am using a function to iterate through several points on the spline per frame to lerp their color based on the player's speed (to change color from green to yellow to red based to warn them to slow down or not, like in a Forza game). I try to be as efficent as possible and only check for points that close to the player and that are previously marked as near corners (at the start of the game I put references to those specific points in a list).

    Is there anything you can suggest I do to stop this from happening? Thanks.
     
    irfanom likes this.
  15. irfanom

    irfanom

    Joined:
    Sep 14, 2020
    Posts:
    1
    I'm having similar problem. Can Dreamteck developers help please?
     
  16. Widdershin

    Widdershin

    Joined:
    May 17, 2013
    Posts:
    3
    Hiya.

    I ended up fixing the issue with the Mesh indexFormat myself.

    If anyone else needs to use splines with more than 65k vertexes, you can apply this patch:


    Code (CSharp):
    1. diff --git a/Assets/Dreamteck/Splines/Components/MeshGenerator.cs b/Assets/Dreamteck/Splines/Components/MeshGenerator.cs
    2. index 280f5fbc..8aebbec4 100644
    3. --- a/Assets/Dreamteck/Splines/Components/MeshGenerator.cs
    4. +++ b/Assets/Dreamteck/Splines/Components/MeshGenerator.cs
    5. @@ -9,7 +9,7 @@ namespace Dreamteck.Splines
    6. {
    7.      public class MeshGenerator : SplineUser
    8.      {
    9. -        protected const int UNITY_VERTEX_LIMIT = 65534;
    10. +        protected const int UNITY_VERTEX_LIMIT = int.MaxValue;
    11.  
    12.          public float size
    13.          {
    14. @@ -469,6 +469,8 @@ public enum UVMode { Clip, UniformClip, Clamp, UniformClamp }
    15.                  Debug.LogError("WARNING: The generated mesh for " + name + " has " + tsMesh.vertexCount + " vertices. The maximum vertex count for meshes in Unity is " + UNITY_VERTEX_LIMIT + ". The mesh will not be updated.");
    16.              }
    17.  
    18. +            mesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
    19. +
    20.              if (_markDynamic)
    21.              {
    22.                  mesh.MarkDynamic();
    23. diff --git a/Assets/Dreamteck/Utilities/TS_Mesh.cs b/Assets/Dreamteck/Utilities/TS_Mesh.cs
    24. index 93164d92..cdf282e9 100644
    25. --- a/Assets/Dreamteck/Utilities/TS_Mesh.cs
    26. +++ b/Assets/Dreamteck/Utilities/TS_Mesh.cs
    27. @@ -346,7 +346,7 @@ namespace Dreamteck
    28.          public void WriteMesh(ref Mesh input)
    29.          {
    30.              if (input == null) input = new Mesh();
    31. -            if (vertices == null || vertices.Length <= 65000)
    32. +            if (vertices == null || vertices.Length <= int.MaxValue)
    33.              {
    34.                  input.Clear();
    35.                  input.vertices = vertices;
    36. ~
    37. ~
    Just out of curiosity, is this package still maintained?
     
    dock and sjm-tech like this.
  17. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    598
    upload_2021-6-23_11-5-45.png

    In Spline Mesh is has an option called 'Use Spline Size' which seems to make no difference. The red edge trim Spline Meshes here are always affected by the scale. Any suggestions?
     
  18. JustinMelzer

    JustinMelzer

    Joined:
    Oct 5, 2020
    Posts:
    2
    Hello

    My question is whether it is possible to switch between 3 different paths

    for example I have a script that lists all the paths that I want to change. I just need the command so I can tell the spline follower which path to use.

    Thanks in advance
     
  19. kyleyoungblom

    kyleyoungblom

    Joined:
    May 1, 2014
    Posts:
    29
    Hello, is there a shortcut for entering edit mode when you have a spline computer selected?
     
  20. ledshok

    ledshok

    Joined:
    Oct 28, 2012
    Posts:
    28
    On the ObjectController, can anyone tell me what the option "Retain Prefab Instances" does?

    Thanks!

    EDIT: Figured it out - if you use a prefab then it creates instances of that prefab rather than simple clones.
     
    Last edited: Jul 25, 2021
  21. matmat_35

    matmat_35

    Joined:
    Apr 20, 2018
    Posts:
    9
    Hello,
    are there any examples on how to use these tools with visual scripting: node creation, access to the positions of each node, scaling...
    This could be really useful!
    Thanks
    Mathieu
     
  22. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    926
    Hi,
    i'm creating SplineComputers via script in editor and use SetPoints to create their content.
    When i select them in the inspector they seem to start in active editing mode, which i don't need as i've already set their points. When manually exiting this mode it stays inactive, which suggests that it's remembered/saved somewhere.
    Is there a way to toggle this mode (off) via script?
     
  23. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    926
    Answering myself: isNewlyCreated = false does the trick.
     
    dock likes this.
  24. Johny_Boy

    Johny_Boy

    Joined:
    Jun 6, 2017
    Posts:
    12
    Hello, thank you for this tool!
    But I have a little problem with the spline projector and the triggers.
    My trigger is set to forward, but the spline projector fires in both directions, is this normal?
     
    Last edited: Sep 3, 2021
  25. Johny_Boy

    Johny_Boy

    Joined:
    Jun 6, 2017
    Posts:
    12
    Ok I noticed a bug, when we loop it plays the trigger no matter where it is placed and no matter (double, forward, backward) as soon as we go from 0.999 to 0.1
    and he also plays the trigger when we move to that position (but he respects (double, forward, back)
     
  26. Johny_Boy

    Johny_Boy

    Joined:
    Jun 6, 2017
    Posts:
    12
    another bug if the trigger is at position 0 or 1 it does not trigger (spline projector)
     
  27. Johny_Boy

    Johny_Boy

    Joined:
    Jun 6, 2017
    Posts:
    12
    I only have problems when my trigger is too close to 0 or 1 like 0.99 to 0.97 it works
     
  28. indiedev37

    indiedev37

    Joined:
    Aug 31, 2013
    Posts:
    24
    Same problem here, any response from dev?
     
  29. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    437
    I have not seen any responses, but they did release a new update on the asset store so I'm not sure. Maybe they'll answer emails?
     
  30. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    598
    upload_2021-9-27_17-55-15.png

    I just lost all the changes on my scene because I typed 0.1 into an splinemesh object size, and it started to calculate as soon as I press 0. Is there any way to avoid this?

    (I realise the developer ignores this thread, but maybe another user can help)
     
  31. unity_738E5FCD7E33E1F76C57

    unity_738E5FCD7E33E1F76C57

    Joined:
    Sep 22, 2021
    Posts:
    1
    Hey , My game player is following the spline computer because of the script of spline Followers. I want to get player current clip point at run time . Is this possible?
    spline follower script have start position but not current position .
    is this any other possible way to access it ?.....
     
  32. crisruiz93

    crisruiz93

    Joined:
    Nov 27, 2019
    Posts:
    2
    I am creating the spline point on runtime, then I attached the Spline computer to the follower and I set follow = true.

    The follower is navigating the spline properly but it is not turning/facing the next spline point. is there an existing configuration in 2D to make the transform rotate facing the next point???



    Code (CSharp):
    1.     void Awake()
    2.     {
    3.         spline = gameObject.AddComponent<SplineComputer>();
    4.         spline.is2D = true;
    5.         _splineFollower.spline = spline;
    6.      }
    Code (CSharp):
    1.     void CreateSpline(Stack<INavigable> originalNavigationPoints)
    2.     {
    3.         var navigationPoints = ReverseStack(originalNavigationPoints);
    4.         int index = 0;
    5.         var splinePoints = new SplinePoint[navigationPoints.Count];
    6.         while (navigationPoints.Count > 0)
    7.         {
    8.             var navigationPoint = navigationPoints.Pop();
    9.             MonoBehaviour mb = (MonoBehaviour) navigationPoint;
    10.             var newPoint = new SplinePoint
    11.             {
    12.                 position = navigationPoint.GetCurrentNavigablePosition()
    13.             };
    14.             splinePoints[index++] = newPoint;
    15.         }
    16.         spline.SetPoints(splinePoints);
    17.         _splineFollower.follow = true;
    18.     }
     

    Attached Files:

  33. crisruiz93

    crisruiz93

    Joined:
    Nov 27, 2019
    Posts:
    2
    Reply from the developer
    upload_2021-10-4_20-8-28.png
     
  34. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Hi everybody,

    I am very sorry for appearing absent and not posting here. I am a little in over my head with everything that has been happening lately. I have been reading all posts here however. Our e-mail support is on point as some of you already mentioned - there was a temporary slowdown with support last year but not anymore.

    I'll try to respond to everybody here with a single post and will keep following the forum thread but I'd like to invite you to join our Discord server as everyone is much more responsive there: https://discord.gg/bkYDq8v

    Before I get to answering, I'd like to announce that version 2.10 is now out with more fixes and some new features:
    Now, for some answers:

    • @HQF , this is still something we are working to resolve. Hopefully we'll have a fix for this soon
    • @redpixelgamedev if you would like to get the distance from the start of the spline towards the projected spline point, you can use splineProjector.spline.CalculateLength(0.0, splineProjector.result.percent);
    • @AdamBaileyMK @marcrem We have implemented fixes related to duplicating, undoing and setting dirty in the last two versions 2.09 and the one we just released - 2.10 - please try updating. I tried to reproduce the issue following @marcrem 's post but I have not been able to so far. If the issue persists, could you provide some more in-depth reproduction steps?

    • @arpan018 you can add a follower behind other followers using Travel. Take the follower.result.percent of the follower you want to add another follower behind and use spline.Travel with Spline.Direction.Back to find the position of the new follower. Then use SetPercent on the follower to tell it where to appear on the spline
    • @rise9912 , the Surface Generator is not designed to create hard edges, I'm afraid. You can use Recalculate normal mode but then it will be up to Unity to decide where to split vertices. About the offset issue, version 2.10 introduces an new property called "Extrude Offset" inside the Surface Generator. I think this might solve your issue.

    • @Ideas966 and @irfanom , this sounds like an issue with multithreading we had and it was fixed in 2.09. Are you using multithreading? If so, updating to the newest version will solve the problem. If not, let me know more about your setups.

    • @Widdershin , version 2.08 introduced a mesh index format option that allows you to select between 16 bit and 32 bit index formats for generating enormous meshes.

    • @dock We'll add such option per channel in the next version to solve your issue. If you'd like to get your hands on a patch sooner, you can reach me in Support.
    • Shortcut for entering / exiting edit mode is Ctrl + E
    • This will be examined soon
    • Which field did you type this into exactly, @dock ? Did you have "auto count" enabled?
     
  35. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    336
    Thank you @Dreamteck !

    So it's pretty hard to find a way for you to reproduce it exactly, but on top of the roads disappearing / going all over the place, we had a huge lag issue making it basically impossible to work.

    What we did: We setup a spline computer and a spline mesh to generate the roads, with all desired settings, then only put 2 points in the spline as a template, then we saved that as a prefab. We did that for many road types so we can place them in our world and use the prefab's link to quickly change some materials / textures on all our roads if needed.

    Doing some testing, we noticed that doing "Unpack prefab completely" on a prefab placed in our world helped a lot. But we need to keep our prefab connection. So we did more testing and found out that something might be happening in editor scripts, because when we did "copy component" on the spline computer, deleted it, then "paste as new component", the fact it was a fresh new Spline Computer made the lag go away a little. It's far from perfect though.

    I will check if the previous bug was fixed as you mentionned. I'm always updating to the latest version of dreamteck before asking for support (good practice I guess), so I'm already at the latest version, normally. I'll check out if the issue of our splines disappearing is still happening.
     
  36. Johny_Boy

    Johny_Boy

    Joined:
    Jun 6, 2017
    Posts:
    12
    Ok Dreamteck!
    Just I have yet another bug, when we delete a connection from a node, is that we re-created a connection, the engine crashes and quits
    I have to completely remove the node and redo it so that the engine does not crash
     
  37. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,328
    Buggy buggy here as well with the LOD system apparently.
    I am just beginning to use this, so I might be wrong, but in that case I would like to know what I'm doing wrong.
    Don't bother about the messed up spline: I have just thrown one in there to see if it worked correctly :D

     
  38. Philkrom

    Philkrom

    Joined:
    Dec 26, 2015
    Posts:
    89
    Hello
    I am using dreamteck splines to move an object over a map with a spline follower. But as I get some issues in VR, I need to reverse the process, I mean the spline moves the map, and the object is still.

    As far as I understand, I have to reverse the spline on its both axis, and then set the splinefollower to the map. My question is : which is the best way to do this ? This could be an interesting feature to be able to "switch" teh movement between 2 objects, as this is only a math formula, right ? Best regards, Phil
     
  39. biscito

    biscito

    Joined:
    Apr 3, 2013
    Posts:
    133
    hey, I love your asset !!!

    i'm trying to slide a ramp, so i need to lerp my position the "automaticStartPosition" target*

    but i don't know how to get it any idea ?

    how do I get the dummy "automaticStartPosition" ?
     
    Last edited: Oct 27, 2021
  40. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    I'll try to reproduce it and get back to you. Meanwhile, just keep in mind we are way more active on Discord https://discord.gg/bkYDq8v and through the support form: https://dreamteck.io/support/contact.php
     
  41. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    To be honest, I'm not sure our system can do that I'm afraid. You could in theory add a script to a spline follower and record the delta while moving and apply that to the map in reverse but I've never seen something done this way so far.
     
  42. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    Use follower.spline.Project(transformStartPosition) to get the projected result along the spline, then use Vector3.Lerp and Quaternion.Lerp to interpolate between the start position and the projected position.
     
    biscito likes this.
  43. Muhammad_Taha

    Muhammad_Taha

    Joined:
    Jun 21, 2015
    Posts:
    22
    Is there anyway to merge all splines through code?
     
  44. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    336
    Yes, I believe it's in the docs!
     
  45. Muhammad_Taha

    Muhammad_Taha

    Joined:
    Jun 21, 2015
    Posts:
    22
    Nope, there is nothing in the documentation to merge spline through code. Although the mention to do it in editor in the scene view.
     
  46. Philkrom

    Philkrom

    Joined:
    Dec 26, 2015
    Posts:
    89
    Hello
    Is there a way to "project" a spline onto a terrain, so that it matches the terrain surface ?
    As this asset does for instance :

    Curvy (another asset I have) has this feature too, but as I am using Dreamteck splines in my project it would be better if I coud use your asset !
    Best regards
    Phil
     
    Last edited: Nov 5, 2021
  47. AmbientLion

    AmbientLion

    Joined:
    Aug 19, 2019
    Posts:
    5
    The latest version of Dreamteck splines doesn't seem to work in Unity 2019.xx ... is this a known issue? Is anyone else able to get it to work? The project imports fine, but creating a new Spline Computer and trying to edit the points of the spline in the Scene view doesn't work (no placement grid, no points drop). Is there a workaround?
     
  48. thenephalem

    thenephalem

    Joined:
    Jun 1, 2017
    Posts:
    13
    Greetings.
    I am having trouble connecting multiple splines. When the character goes pass a node my game freezes and OnNode(List<SplineTracer.NodeConnection> passed) is called numerous (>500) times.
     
  49. RobertRCVR

    RobertRCVR

    Joined:
    Dec 3, 2020
    Posts:
    1
    Hello,
    I am using unity 2021.2.1f1 and I am facing an error when I want to edit my spline. Mainly when I press Q,W,E, or R I am getting this error

    The targets array should not be used inside OnSceneGUI or OnPreviewGUI. Use the single target property instead.
    UnityEditor.Tools:set_current (UnityEditor.Tool)
    Dreamteck.Splines.Editor.SplineEditor:DrawScene (UnityEditor.SceneView) (at Assets/Dreamteck/Splines/Editor/SplineEditor/SplineEditor.cs:291)
    Dreamteck.Splines.Editor.DreamteckSplinesEditor:DrawScene (UnityEditor.SceneView) (at Assets/Dreamteck/Splines/Editor/SplineEditor/DS Editor/DreamteckSplinesEditor.cs:217)
    Dreamteck.Splines.Editor.SplineComputerEditor:OnSceneGUI () (at Assets/Dreamteck/Splines/Editor/SplineComputerEditor.cs:268)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    Any solutions?
     
  50. Dreamteck

    Dreamteck

    Joined:
    Feb 12, 2015
    Posts:
    336
    There isn't a single method that will allow you to do this currently but you can try starting with the Merge method inside ComputerMergeModule.cs and going from there.

    ---
    Did you know? Support is faster on our Discord Server.