shaders and images duplicates

hi!

I have a huge scene with a lot of objects. We work in a team so each one is preparing the various asset is separate blend files and then we import them in the final scene.

many of these objects use the same material.

My problem is that when I import the objects the materials gets duplicated. So if I have a material called marble, then each object with that material will have marble.001, marble.002 and so on. What is worse is that this happens also for images so the same marble01.jpg becomes marble01.jpg.001, 002 and so on.

I am constantly fighting with optimization to fit the scenes in the video card memory and I noticed that duplicate images gets all loaded in the memory.

What is the best approach to go through the scene images and shaders and remove duplicates?

I know I can see a list of the materials in the outliner for example, but I couldn’t find a way to do the same for images.

Is there maybe some plugin?

Thanks for any help!

In the Outliner menu find ‘Blender File’ mode. There is a list of the images in the Images section and you right click for a popup that contains delete.
Hope that helps. I just tried it 2.86c.

If you simply select all the objects intended to share the same material, with the final one containing “Material”, then CTRL L and select Materials. Save and reload, and all the duplicates of that material should be gone. (I can’t test for certain, I’m at work without access to Blender, but pretty sure it should work).

thanks for your answers

@Shadowpile: unfortunately I cannot find a way to see where the texture is being used. I cannot just delete a texture I need before to find where it’s being used and change it to the good texture. Do you know if there’s a way to see in which shaders a textures is being used?

@Roken: I know this method, but believe me that’s easier said than done in a scene with some thousands objects…

IMO, the best would be to have a blend file with all common materials, and have them linked in the blends with objects.
Not only is better to organize, change, etc, as the materials won’t be dulicated.

To use the normal method, can you, as a collaborative team, not simply save objects with a common material in separate files. That way, you can append common objects into a single scene, fix up the textures, and save as a single file (this way, you simply select all and share the material). At the end of the process, you append the saved scenes together.

Voila, no duplicated materials and everything where it should be.

Whenever you have a team working independently of each other, someone at some point is going to have to organise/consolidate it all.

this will fix that:

Thank you again for your help guys! :slight_smile:

@Secrop and @Roken: yes I definitely need to refine the team workflow, that’s the best way to avoid this situations :slight_smile:

@PyroGXPilot: I already tried that plugin but unfortunately in my scene I get an error… I guess the mess is too big :smiley: Thank you!