Search Unity

[Published] Spline plus- Spline mesh deform

Discussion in 'Assets and Asset Store' started by elseforty, May 21, 2018.

  1. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    290
    I'll try to replicate the issue following the steps you described above,
    if i can't get that replicated on my end then i suggest adding a drop down list to switch beween modes as a solution for this issue,
     
  2. trurkowski

    trurkowski

    Joined:
    Sep 3, 2019
    Posts:
    6
    I came here looking for something else but I have customized the context menu to activate on spacebar - and it relieved similar issues I've had with the scene view locking up.
    (on win 10/, 2021.3.8, Built in RP)

    Change line 97 in SceneViewDisplay.cs to match mine
    upload_2022-11-11_16-29-4.png

    by default spacebar brings up the scene view overlay menu, but I rarely use that, so I just removed it in the shortcuts menu to avoid conflicts.

    I have still experienced the locking even with this change, but it is less often, and only when doing things like fuse/diffuse for branches. (I think, I haven't played around long enough to get a consistent pattern, apologies!)
     
  3. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    290
    Hi,
    i followed the steps as you described above still i could not manage to replicate the issue, can you please record a video, this could help me a lot
    concerning forcing the mode change without using the esc key, please add this line to your SplinePlusEditor.cs line 94
    Code (CSharp):
    1.         SPData.User_Action = (User_Actions) EditorGUILayout.EnumPopup("Mode: ", SPData.User_Action)  ;
    this will add a drop down list with all the modes available

     
  4. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    290
    Hi trurkowski,
    thanx for sharing your solution, i can't really test it since i can't manage to replicate the issue on my end, i hope it helps other users ,
    if anyone is experiencing this issue please try this and let us know if it works
    thanx
     
  5. trurkowski

    trurkowski

    Joined:
    Sep 3, 2019
    Posts:
    6
    Hi me again!
    So as full context here, and as a potential path for debugging on your end, I bought spline mesh deform through that unity bundle a few weeks ago. I have made a video showing the issues I've been having with basic scene view controls, and also the import/export function for .sp files.

    Again, for the most part, the scene view control locking is fixed by me swapping the event for opening the context menu - but I hope it gives you a starting point in potentially solving that for others!

    I've got video for you and will be DMing the project itself (cleaned of any other assets) just in case that gives you any other insights.



    Here's that error:
    Length cannot be less than zero.

    Parameter name: length

    System.String.Substring (System.Int32 startIndex, System.Int32 length) (at <c2a97e0383e8404c9fc0ae19d58f57f1>:0)

    SPFile.ReadSplinePlusFile (System.String path, ElseForty.SPData sPData) (at Assets/ElseForty/SplinePlus/Plugins/SPFile.cs:172)

    ToolsBareEditor.Import (System.Object obj) (at Assets/ElseForty/SplinePlus/Editor/ToolsBareEditor.cs:91)
     
  6. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    290
    Thank you for sharing the video,
    i managed to replicate the export import issue of the .SP file, it turned out that this problem only happens when on windows machine while it works perfectly on a mac Os,
    the issue was "Environment.NewLine" not working properly on windows.
    to fixe this just look for Environment.NewLine in the SPFile.cs and replace this with "\n" , it is repeated 3 times in total
    example

    Code (CSharp):
    1.         string SplineSettingsStr = splineSettingsData[1].Substring(0, splineSettingsData[1].IndexOf(Environment.NewLine));
    2.  
    Code (CSharp):
    1.         string SplineSettingsStr = splineSettingsData[1].Substring(0, splineSettingsData[1].IndexOf("\n"));
    let me know if this works for you
    Best regards,
     
    Last edited: Nov 13, 2022
  7. trurkowski

    trurkowski

    Joined:
    Sep 3, 2019
    Posts:
    6

    That worked great! Thank you.
     
  8. royaldrope

    royaldrope

    Joined:
    Jan 12, 2022
    Posts:
    1
    Merhaba bu sorunu nasıl çözdünüz acaba bende aynı şekilde hata alıyorum. Oyun çalışırken komut dosyasından örgü deformasyon düğümü konumunu değiştiriyorum ama donuyor. Sadece nesneye tıkladığımda çalışıyor.
     
  9. wjsehwls

    wjsehwls

    Joined:
    Dec 18, 2020
    Posts:
    11
    Can I use this tool to draw a lane on the terrain and mesh in a texture decal? 20230307_115651.png

    Can I use this tool to draw a lane on the terrain and mesh in a texture decal?
     
  10. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    290
    Hi @wjsehwls , you can use a plane mesh in spline mesh deform then project the spline generating the plane mesh on the terrain, this could not be a considered as a real texture decal but it works really well.
    let me know if you have any other questions
     
  11. wjsehwls

    wjsehwls

    Joined:
    Dec 18, 2020
    Posts:
    11



    20230308_190322.png


    OHH I SEE .. And Does it work like a sticker on a mesh object?
     
    Last edited: Mar 8, 2023
  12. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    290
    Sorry for the late reply,
    the solution I described above is not a decal texture solution, it is something that you can use to emulate decal texture
     
  13. Damocles

    Damocles

    Joined:
    Jul 21, 2012
    Posts:
    46
    Bug report:

    Hi, I'm using spline plus to deform a simple fence mesh, in a straight line, but there's an issue with the normals (or maybe tangents?). In this image: fence1.jpg
    you can see two copies of the fence mesh, manually placed in Unity. The middle is smooth as expected. In this image: fence2.jpg

    You see a fence created by Spline Plus DeformMesh. A simple, 2-node (free type) line that places two copies of the fence mesh. You can see the join between the two meshes, as the lighting is different. The wireframe view: fence-wireframe.jpg
    shows the verts are correctly positioned, so I'm assuming the issue is normals and/or tangents. Finally, this image:
    fence-sharevert.jpg
    shows the fence column where the shared vertices are wrong. The smoothing is lost because Spline Plus seems to be creating two vertices where previously there was one shared vertex.

    I've tried calling RecalculateTangents() and RecalculateNormals() on the resulting mesh, this did not fix anything.

    What are the chances of this getting fixed?

    Here's the fence mesh if you want to test it yourself:
    fence-simple-iron.zip
     

    Attached Files:

  14. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    290
    @Damocles Hi,
    sorry for the late reply, i just got time yesterday to check it out, seams like you can easly get ride of this issue by commenting RecalculateNormals() in the DeformedMesh.cs => DrawMesh_Branch()
    this will preserve the original mesh normals
    let me know if this works for you
     
  15. Damocles

    Damocles

    Joined:
    Jul 21, 2012
    Posts:
    46
    @elseforty that seems to have fixed the issue, thanks for your help.
     
  16. Asarge

    Asarge

    Joined:
    Jun 2, 2018
    Posts:
    26
    Hi elseforty,

    Would this asset work well for a rail grind in a 3d platformer where the player could attach/detach from any point? Looking at the examples it seems the follower attaches at the start of the spline but I would like to have many separate rails throughout the world where you can initiate the follow sequence from the point of contact and leave whatever point on input. Is this possible and if so could you give a semi-pseudocode example of how you would call this SplinePlus function from an external (player) script?
     
  17. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    290
    @Asarge you can do that, what i can think of is try to figure out the closest point on spline plus branches to a click point,
    a branch is just a list of vertices with vector 3 position, you can mesure the distance between each branch vertex and the click point and return the closest point easly.
    if you have purchased spline plus or spline mesh deform i can write you a code example next wednesday or thursday, just email me at elseforty@gmail.com so i can know your email
    thanx
     
    Asarge likes this.
  18. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    290
    @Asarge i didn't get any email, have you sent it to elseforty@gmail.com?
    please share with me your email in case you have already send it, it could be in spam