Eliminate duplicate materials .001 .002 .003 after Append

how do you run this script?
is this added as an operator and where ?

will try to understand it but not easy!

thanks
happy bl

what did you change ?
is it for 2.8 ?

i’m on 2.79 for now
but would definitively like to get it for 2.8
very useful function to clean up mat

I run script from the text editor
but cannot find the operator name in object menu bottom header
where is it ?

thanks
happy bl

found it ta top of object menu !

here is sample file with multiple mat on a motor
with many mat like bumpy bumpy.xyz
it seems to change the name of all bumpy mat but does not
re assign face to the base mat !

will PM you file
would like to keep model private if possible

thanks
happy bl

Hi RickyBlender
This updated version is been maintained by brickmack not by me anymore. Please contact he in github.

Ricky, I think my addon is exactly what you’re looking for. Pick the material slot in your object materials that is the one you like. For example, it could be Mat.004 in the list Mat, Mat.001, Mat.002, etc. Then select the Material Specials menu > Clean Cad Mats and it will update all materials in all objects that use a material with the prefix Mat to the currently selected slot. It could be assigned to individual faces or the full object. It doesn’t matter.


I made this for imported cad objects. I would import an file with hundreds of bolts each with a different material. So I could have bolt_material.001 through bolt_material.965. I would find a bolt and modify the material, but then I’d have to change the material for the other 964 bolts. This lets you modify one instance of the bolt_material and then it goes through all of the objects in the scene and replaces any instance of the bolt_material with the one you just modified. The number of vertices has no effect on performance.

Edit: I’ve updated it to work with 2.80 as well.

1 Like

I am trying to understand this.Should each material have only one user and no duplicated material in a blend file. My lower kitchen cabinets have cases and cabinet door frames which are all a blue material. For 10 lower cabinets I only need 1 material because those objects are all the same material. In 2.80 in the material panel next to my “Gloss paint blue” it says there are 190 users of this data. To clean things up I should I be clicking on the 190 to make a single user-copy? Then should I be going down my list of materials in the blend file and make each material a single-user copy? Here is the problem I have with my blend file. My blend file is just over 500 mb. When I automatically pack my blend it increases to over 900 mb. The reason I think it is so large, and correct me if I am wrong, is because when I appended my model to my scene, I appended a model, which was in it’s own folder, but was in a folder higher up with say 200 other models from the same company. So this folder which I will call folder X contained 200 folders, each with a different model, each model with it’s own materials. Is it possible that when I appended this model that blender appended the material from all 200 models. I just don’t know why my blend is so large. When I try to pan, zoom or orbit in my scene while in Look Dev Render Mode blender seizes up and crashes. And it initially takes 15 minutes to render in this mode. So I have to decrease my file size. So I think I have a lot of materials in my blend which have no users. If I purge my materials will these materials be deleted? I think these materials are called orphan data. Then make the rest of my materials single-user materials. Then will I be able to pan,zoom, and orbit in my scene? My GPU is not working so I have cycles render set to use only my CPU. In preferences I have disabled my GPU. Please let me no if my logic is correct in eliminating duplicate materials. If I am thinking correctly it should all be able to be done without an addon. Thanks

I see now that you cannot click on a material without changing your objects material. So you need the addon to prevent this. And I probably did not import all the materials from the 200 objects. Only the one. That is what my file now shows unless they were removed when I purged my orphan data. I will look at some files where I did not purge the orphan data to see if that is the case. Can someone let me know if there should only be 1 user for each material? Thanks

After cleaning cad mats my users for my green material went from 26 to 29. Why is this? How many users should there be for my green material? Thanks EDIT: Gloss paint green.003 was cleanedb4%20cleaning%20cad%20mats|206x499

The 8 Glass duplicates in this picture can be eliminated by using Clean Cad Mats on the Glass Material at the top. None of my objects will lose their material? Is that correct? Thanks EDIT: It looks like that Glass is already alone. the next one down appears to have 7 duplicates so that is the one whose object i need to find and then Clean Cad Mats. Is that correct?

I PM’d you about this.

1 Like