Hello there; I've been working with Blender and Unity for a while and discovered the awkward snag regarding instances; the importer makes every imported object a unique instance. Since I'm also using Blender as a level editor, you can see where this might be a bit of a problem...
I've written a quick AssetPostprocessor to try and catch duplicate mesh instances and clean them up; full technical deets (and code if you just want to copy/paste it) are
here on my blog /obligatory shameless self-pimping.
To be completely clear, the post-processor does
not detect instanced meshes! It compares meshes with the same names off against each other (where names are absent anything after the last underscore, such that the name 'Cube' and 'Cube_001' are 'the same'), checking submesh count, vertex count and the origins / sizes of their bounding AABBs to 'judge' meshes as being duplicates of one another.
Under specific circumstances, finding two meshes identical that
aren't instances is perfectly possible, and equally it can find two meshes that are instances unique if they have different modifiers on them (which is probably desired behaviour to be honest).
It's one of those little Unity things that can be a complete pain in the ass to deal with; hope this helps some people!
If anyone has any problems with it / has advice on the mesh equality test (it
should be thorough enough without directly comparing vertex lists), feel free to leave a message and I'll try and sort it out.
Replies
Definitevely looking into this. Thank you again for sharing.
@Guessmyname not trying to take away from the awesome work youve done. Im sure for blender fbx export this is greatly needed.