what's wrong with this mesh ?

Hi, guys… i’ve tried to solve this problem for a week, but no results =(. It seems to be a problem with convex collider generation. My steps are this:

  1. i dinammically create meshes ( normals are calculating via mesh.RecalculateNormals();):

  1. when i add mesh collider to the first object, and set it to convex, it seems to be okey:

  1. when i add collider to the second object, and set it to convex, i got an errors and no collider:

See large screanshot

  1. But, when i export mesh with ObjExporter, and load blender end export it back to obj, and load it to unity, it works but incorrect and with broken normals…

every triangle on a mesh have no shared vertices, on first and second object, but if it has them, then normals are broken without export, even if i use standart (recalculateNormals()):

it’s name would be a third object (in a project i attached).

5)if i opened third object in blender (with shared vertices), and select non-manifold, no vertices are selected;

click to view large screen shot

  1. and if i export that object via blender (from 5th stage), and import it to unity, it works like first export (and broken normal also)

1072875–40069–$bad project.zip (322 KB)

How can i solve this problem ? any idea ?

Please do not create other posts directing back to this one. Thanks

Ok

I open the project and the first thing I read is:

If you see any such error, you don’t even need to try to go on, because something is broken.

Import first.obj in Blender and save the .blend file in your Unity project. Like that it should be imported automatically. Done. Works for me, both the mesh and the collider.

Deleted… Thanx… And sorry

You can easily dynamically create the convex hull, but that requires valid mesh data. The mesh data is not valid which is highlighted in the import error.

ok, i’ll try then reply. But how i understood, the problem is in uv coords, i haven’t made them… and thought that they are not important ?.. mesh is correct i think, normals… sometimes (lol)… i mean they ok, if not shared vertices, if they, then mesh is not closed (manifold), if not, then normals are broken… lol =)

In which application do you create your meshes? If you create them in Blender, you may try to save them directly in the Unity project folders, such that they are automatically imported. Like that, you avoid a lot of trouble like that one.

As soon as you start to texture your model, the uv coordinates are going to be very important! After all everything is important, otherwise it would not be necessary and would not be there…

i dont need uvs, because i’m doing convex decomposition to make colliders, this meshes are used only for them… and i make them fro other script in unity.

Ok. I’ve added uv’s code, but it gives no planning result. i’ve tried to repeat your actions but i got this error:

More interesting thing is that after importing second object.blend, convex mesh also is not full… wtf ???.. all day i was busy for other things.

i’m using blender 2.64, and unity 3.5.5.f3:

If you use the Blender Installer and not the zip file of Blender, then the import should work. Another option is to export the object with the fbx exporter of Blender, which is used internally when you import a .blend file into Unity directly.

You should cool down! There are several steps that need to be done one after another. The FIRST one does not work! Why should the following ones be valid that build on it? Let’s get the first one, then the second one, … . Everything else is wasted energy and nerves!

Thanx for advice, i know it, i’ve posted here question, which is: how can i edit second mesh to make from it right convex collider. My blender was installed from an installer. Import worked fine and with .blend files too, this error i took firsttime. And i don’t know whats wrong with that mesh, and i need edit it at runtime of my unity project to make mesh correct. U said that your unity makes it right, can u check normals from second mesh, and imported second mesh please, and say differences. I think that the problem in normals, but i can’t make mesh work right to check this. thanx

If I import second.obj into Blender, save it in the Unity project folder, Unity has now issue to import it. The normals are correct in Unity and in Blender.

than… whats wrong with than mesh. How can i do collider from second mesh? Anyone ?

Use the mesh you are getting from the fbx instead of the obj.

SomeBody, please, say is it bug in unity or in my mesh, if in mesh… where ?? i’ve broken my brain =(((

As far as I know obj is not officially supported by Unity, but fbx is. Is there a reason why you can’t use fbx?

yes, i need create mesh throught script, and don’t need it to be exported or imported. I’ve post here exports to show my problem (

You get invalid meshes because you import them with obj format. Then you try to go on with that invalid data. Import your meshes with fbx, then you can be sure that you have valid data. If you have problems with a specific fbx file. Post the whole script and the fbx here.