Importing an FBX and automatically assigning textures

I hear you, there is an option to flip material normal’s, but it looks like the normal’s aren’t inverted, but messed up and Unity is fixing them. You could try with the material, the the very bottom and often off screen there is a material option for flipping normals or turning them off. I suspect this isn’t really the issue though and some thing in the pipeline is messing up the normals.

Well there are lots of things on the internet about Maya models having the same issue. I don’t believe that the normals are wrong, just in the wrong order etc.

It’s because Unity has a reversed X coordinate. I can import models in Unity and fix this for export myself by writing the FBX file with a negated X coordinate. This is a nightmare though as Unity requires me to output the models into the project and then happily goes off and imports them again. It takes hours. If PlayCanvas could just let me specify that it would be great. I guess I could try to write a utility to do this external to Unity but normally I also want to pack in the textures and Unity makes that easy:

for (int i = 0; i < triangleCount; i += 3)
                {
                    if (i > 0)
                        tempObjectSb.Append(",");

                    // To get the correct normals, must rewind the normal triangles like the triangles above since x was flipped
                    Vector3 newNormal = normals[triangles[i]];

                    tempObjectSb.AppendFormat("{0},{1},{2},",
                        newNormal.x * -1, // Switch normal as is tradition
                        newNormal.y,
                        newNormal.z);

                    newNormal = normals[triangles[i + 2]];

                    tempObjectSb.AppendFormat("{0},{1},{2},",
                        newNormal.x * -1, // Switch normal as is tradition
                        newNormal.y,
                        newNormal.z);

                    newNormal = normals[triangles[i + 1]];

                    tempObjectSb.AppendFormat("{0},{1},{2}",
                        newNormal.x * -1, // Switch normal as is tradition
                        newNormal.y,
                        newNormal.z);
                }

Basically the triangle are wound the wrong way in these Unity models. But given there are literally 100,000s of these things available for Unity it would make sense to make them easier to use I’d think :slight_smile:

Yeah, with out the engine team stepping in here I can’t offer any other suggestions

Yeah I was just kind of updating this thread as previously (when I first posted) these were custom models. I’ve since realised it is happening with everything Unity :slight_smile: