Avoiding Duplicate materials

Hi All,

Forgive me if this is in the wrong section.

I am looking for information on best practices or guidelines or even suggestions about how to organize our project so to avoid having duplicate materials, or if this is even necessary. Say for example I have a static mesh of a building that uses a material for Concrete that is imported into my content browser in a folder called Buildings. This folder will contain the Static Mesh asset, a Material asset and the Texture asset, since I specified I wanted to import Materials and Textures. I also have a static mesh of a sidewalk that uses the same Concrete material. The sidewalk mesh is imported into a Props folder, using the same options as previously. I now have the same Materials and Textures in 2 different folders. So my question is, what is the best/preferred way to avoid having these duplicates? Or is it even necessary, will the engine know that the 2 meshes use the same material and not cook/package the 2 different ones?

Hopefully that question was clear enough for someone to understand what I am asking.


I personally always do it like that:

  1. import the mesh without texture into the static mesh folder
  2. import the texture into my texture folder
  3. create a master material for concrete stuff
  4. create a material instance constant + add the texture to the parameters
  5. assign the MIC to all meshes

You dont have to do the part with the material istance constant, but when you have different concrete textures, it will be a good and efficent way to do it.

So basically I have everything in 3 different folders:

Otherwise you will always have to delete the material + texture -> but when you import the mesh into the same folder, it will probably overwrite the materials/textures :slight_smile:

Thanks for the reply fighter, that way makes sense but it seems like it could become a bit of a time consuming process.

I am working as part of a larger team with assets that were already created and we are trying to automate and speed up the import process, while still keeping things organized and avoiding duplicates. We wrote a custom plugin that we use for importing that could move our materials and textures into a central Materials and Textures folder and update the references in meshes to point to the central folder and remove the ones that the engine auto creates in the folder with the mesh. This seemed like a good approach but it also seems to cause issues because the engine ends up creating redirectors and it adds more code to maintain and bug fix etc. I was feeling like we might have been overcomplicating it and wanted to make sure there wasn’t a better way.

While your way seems to be less error prone it also doesn’t seem like it would be the most efficient, but i appreciate your input.

Edit: Just wanted to add that another reason why it would be time consuming is we have meshes that have multiple materials, and not just one like in my example. So we would need to open each mesh and click multiple drop downs and file the right material to assign to each Material index, and then do this again for each of the LOD levels.