I’d like to export as fbx into unity. But if there are materials assigned, I end up with many unused materials cluttering the project as I’m assigning various materials within unity. The solution seems to be to delete the materials in blender before export.
However, I’d still like to preserve submesh information so I can assign individual materials to the submeshes within unity.
It’s unclear for me what you mean: In Blender there is no such thing as submesh. If you have one mesh object there can be multiple parts of that mesh holding different materials and this parts can also be not connected. If you want some thing like a hierarchiy you have to parent different mesh object… If you separate meshes then both object will have all materials even if it has someones not applied to any
geometry…
I think what he means when he combines 2 seperate objects, he would like to have the Matterial Assignment on both Objects seperate so he can Shade dem individually.
Actually i think you can’t get the Material Slots without having a Material assigned
Joining object also joins both material to the joined object. Also you can add a material slot (+ icon) and then select (ball like icon; left to +New) any existing material you like…
When you import a model into unity, if the object has multiple materials assigned to different faces, they become submeshes of the whole mesh. Then, each submesh can be assigned a material without creating seperate GameObjects - and this is often better for performance.
The issue is, is that if the fbx is imported with assigned materials those materials become a part of the unity project. If I import 50 models each with 3 submeshes each, I’ll have 75 completely useless materials cluttering the project that won’t be used, and that can’t be deleted because they are a part of the imported object. (They are unused because I’m assigning different materials procedurally)
It seems the only way to import an fbx without materials, is to delete the materials off the objects in Blender, but this also removes the submesh information.
It turns out, there is a way for unity to discard the imported materials, but it’s just somewhat hidden.
(For others: on the fbx object, there is a material tab in the inspector, then Material Creation Mode should be set to None. This will preserve the submesh slot, and discard the assigned imported materials.)
Ahhh yes now i get it. Unused material cleanup by blender ( i blelieve there are soem addons…) or unity… Nice that you got some kind of solution in unity and post it here.