Know the triangle number (not count)

Hi, is there a way to know the order of the triangles in a model (triangle 5 of 20 for a 20 triangle mesh, for example)?

I have a weird export bug, where blender/unity switches the materials and I suspect that the first triangle’s material is the one unity sees as being the first material of the mesh.

Thank you

If you start blender with the flag “–debug” (say, from the command line), and then open display properties panel (the one on the right of the 3d view), and you are in Edit mode on the mesh, look for the “Numerics” section and check the “Indices” option. Then go into face selection mode and select all the faces. You will see the number (“index”) of each face on the display. (There’s also a way of setting the --debug option from python, in the python console window, but I forget what it is right now.)

This assumes your model is really triangulated in your Blender viewport (since you asked for “triangle number”). If the model is a mixture of tris, quads, and ngons, and you are asking about what happens when they are all triangulated on export, then this answer doesn’t help.

Yes, there is a way. If the export format is pure text, you can go and look into the file itself. Any way, that’s all Unity sees so, even if Blender would give you a number, it would be totally irrelevant.

If you really want to persist in this direction, try a Build modifier. Blender will show in what order the faces are stored in its head. Another totally irrelevant piece of cr… information since only the export file matters.

More seriously. Don’t try to think too hard. If Unity inverts the materials then do it too! Clone your first material, select all the faces with this material, apply the clone, delete the now unused material. Save, re-export… and see what Unity thinks of this new file.

It looks like you stumbled on a bug in the export… or it’s a picnic. :wink:
( )