Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Severe bug with some types of Prefabs/meshes
#1
Bug 
Hello, 

There is an exception in DeformMesh line number 499:

Code:
Vector4 inputTangent = inputMeshTangents[sortedVertexIndex];

This happens on only SOME types of meshes and prefabs and this error only happens when the project
is built as exe (Am using Mono backend as IL2CPP completely fails)

I am attaching the package of the prefab/model in question.

Can please fix? 


Thanks


Attached Files
.unitypackage   Road01.unitypackage (Size: 47.06 KB / Downloads: 1)
Reply
#2
Hi
Noted. Working on both your issues right now. Will keep you updated.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
Sorry I forgot to mention.

Curvy version is 8.1.0 and Unity is 2020.3.33f1, thank you for the quick reply
Reply
#4
Ok, managed to reproduce this one, and found a work around. I still need to look deeper into this and make sure this fix is solid, but if you are in a hurry, here it is:
In CGData.cs, go to line 2004, and replace this line:
private static readonly Material NullMaterialDictionaryKey = new Material(Shader.Find("Diffuse"));
with this one
private static readonly Material NullMaterialDictionaryKey = new Material(Shader.Find("Standard"));
Will keep you updated
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#5
Unfortunately am still getting an exception even when I apply the said code change Sad 

I've attached a screenshot of the error

Edit: btw, if I add a standard cube into the Prefab then it works but if I just have my road prefab as-is, it crashes Sad (Only in the mono build, not in editor, editor works fine)


Btw, you will have to enable the development build to see the exception otherwise it's silent and Spline segments can't be added dynamically, it goes completely unnoticed otherwise and you notice is when you debug

I don't know if this will help but it seems that, inputMeshTangents is a vector of size 0 as inputMesh.TangentsList.Array seems to be
unpopulated. If I add a simple cube to the game object then it works.


Attached Files Thumbnail(s)
   
Reply
#6
Could you please tell me how you reproduce the issue. In other words, what does the build scene do? If possible sharing that scene/project would help.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#7
The project is over a few GB, so will make a repro project. Please give me 40 minutes or so.

In the meanwhile if you'd like, I can explain, this exception is unnoticed but you'll notice that InsertAfter calls on that spline will not work when you supply this particular mesh inside your game object.

Or even easier you can notice the exception if you make a development build and attach your debugger to it, it'll break at the line I screenshotted.
Reply
#8
I can't seem to be able to reproduce this issue. Will wait for the repro case.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#9
I have sent you the repro project in PM if you build it you'll understand what I mean, the control point is not added dynamically through script in the windows build, but it is added dynamically in the editor, and if you do a development build it will throw many exceptions in the error log on screen (you can even attach it to your debugger and it'll break at the line with the exception)
Reply
#10
Hi

After further investigation, here is my conclusion about this issue:

The issue happens because of the combination of two issues, one on me, and one seemingly on Unity:
  • Issue A: The one on Unity: Your fbx model file has no tangents in it. Unity, following the settings on the model import settings, generates tangents for that model (based on its geometry). The issue is that those generated tangents are present in editor, but are not in the build. As far as I see it, this is a bug in Unity. I tried different variations of the import settings, and none solved the issue.
  • Issue B: The one on me: when a mesh has no tangents, the deform mesh module throws exceptions.

Now, about the solutions:
  • Issue A: the short term solution is to reexport the fbx file but this time with the tangents included. Also I recommend that you open a Unity bug report raising the issue.
  • Issue B: I will soon prepare a fix for it Once prepared, I will send it to you via PM. If it works with no issues with your project, then I will include it in the next update of Curvy.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Input Spline Shapes from Prefabs destroys graph tairoark 5 6 11-24-2022, 05:08 PM
Last Post: _Aka_
Photo Can't export custom collision meshes Mike Danielsson 5 7 10-14-2022, 10:36 AM
Last Post: _Aka_
Question Including scripts on created meshes lewsk55 1 11 10-04-2022, 10:46 PM
Last Post: _Aka_
  Can I extract prefabs from Curvy's generated meshes? niuage 7 18 03-15-2022, 11:44 AM
Last Post: _Aka_

Forum Jump: