For instance at http://docwiki.unity3d.com/index.php?n=Main.class-Mesh
it states that Unity is able to import and understand files of the type obj. But when I try to import an obj-file Unity says:
“The mesh of default has 1 sub meshes but the renderer is using 7 materials. Your mesh should use the same amount of sub meshes as materials”
Is this only a problem of configuration of Unity or how do I get Unity to show the graphics from a .obj-file?
Guess it’s a problem with the way the .obj is exported by the 3d program which made it.
You could try opening the .obj in a text editor, and search for usemtl. whenever you find a line like
usemtl materialname,
add a line
g materialname.
That should split the mesh into groups/submeshes according to the materials - maybe unity would import it then. I guess ideally unity’s obj importer should automatically generate submeshes based on materials.
I have opened the file in Xcode, searched the entire file for “usemtl” and pasted a new line under it saying “g materialname”.
But when I try to import it in Unity I still get the errors:
“The mesh of materialname has 1 sub meshes but the renderer is using 7 materials. Your mesh should use the same amount of sub meshes as materials.”
“Meshes may not have more than 65000 vertices at the moment”
What can I do to correct this problem?
It seems there is something wrong with the 3D file; It has too many materials attached to the mesh.
Unity does not support meshes with more than 65k vertices at the moment - so you need to break the model up in your 3D app into several meshes. But if you’re building stuff for web, 65k polies will kill the majority of consumer cards out there…
Oh, I see. I’ll just have to work with smaller objects then.
Thanks for the help though.