3DS Max -> Unity Morphing Vertex problem?

Hi all,

Ok, so Starmanta and I recently submitted ‘Castles’ to the TopDOG competition, and one of the core elements is that as you build up your castle, it grows. This growth is achieved via mesh morphing. Now, of course to morph two meshes have to have the same number and order of vertices…

So here’s my problem: Unity and 3DS Max seem to have entirely different takes on my model when it comes to vertices. For example, if I get a readout of a castle model in Max, it has 4,914 vertices, but when imported to Unity, the mesh morpher claims it has 11,170. Also, if I move some vertices in max (aka animating), and export the new model, Unity will often claim that this new model has a completely different number of verts than the previous morph target model (like 11,168), even though nothing has changed but the verts’ positions…

This has happened numerous times on different models, and I’m at my wits’ end cuz for the life of me I can’t get a consistent export vert number…

So does anyone have any idea what could be happening or how I could fix this? Thanks in advance for any assistance, it’s greatly appreciated.

Are you working in quads or triangles?

Each of the models is a single Editable Mesh, so triangles.

There’s been a topic or two on this subject. The problem is that Unity has to split vertices for various reasons like UV mapping and normals. In the import settings, if you set automatically calculate normals to 180º, then the vertices won’t get split because of normals. (In order to make a hard edge, Unity has to duplicate vertices.) Quads vs. triangles would only affect the number of polygons, anyway, rather than vertices.

–Eric

Or turn “calculate normals” off in import settings. Then it will use them as they come from 3D application.

Thanks for the quick replies guys, the help is tremendously appreciated.

So turning of the autocalc normals on import worked like a charm to fix the vertex count issues… however much to our dismay now we have a new one. The meshes import fine and look perfect until we go to morph them, then all of a sudden all of the triangles go berserk and attach themselves to the wrong vertices… resulting in something like you see in the picture.

Like I said, the mesh looks fine until we try to morph it, so could the problem be in the meshmorpher script? Or am I once again doing something wrong that’s causing a bad translation of data from 3DS Max to Unity? Something entirely different?

48363--1769--$screwytower_179.jpg

Try printing the contents of triangle lists of both meshes. They should match. Also the vertex count and the triangle count should obviously match.

Ok, so we did the triangle count thing, and it seems that almost all of the triangles have at least one vertex that’s changing… however the meshes morph perfectly in Max… so what’s the solution?

Tried to do a workaround by animating the morph in Max and then just importing the pre-morphed animation, but apparently Unity doesn’t import morphs from Max’s .fbxs… so we’re really stuck here. Does anyone have a theory as to what I’m doing wrong and/or how to fix it? Any help would be greatly appreciated guys, thanks in advance.

I don’t have a solution, except that I’ve tried mesh morphing many times and it is very brittle and breaks extremely commonly with regards to vertex count of imported meshes. :-/

-Jon

Having the same issue. I figure its because in any engine to represent a hard edge, the engine must split the vert and make 2(or more) verts to render the hard edge, this changes the vertex order and stuffs up the morph target.
I’m just having to make do with the soft edges.

Theres probably a way to code a resample of the morph targets in-engine for split/hard edges but thats way beyond me as a lowly game artist. If anyone works out a workaround let me know.