Clean Cad Mats

Clean Cad Mats

Merge duplicate materials.

This is a simple addon for merging like named materials. This serves a common need for imported cad data. I often ran into issues with large assemblies imported into Blender where I may have hundreds of bolts each with a unique material (bolt_mat.001, bolt_mat.002, bolt_mat.003, bolt_mat.004, bolt_mat.005, bolt_mat.006, etc.) whereas in the cad software the model originated in, these were all a single material that could be edited one time and all instances of the bolt_mat would be updated. Manually re-assigning hundreds of materials proved to be very time consuming.

With Clean Cad Maps, you can choose which version of the material to keep and replace all materials that have the same base name. For instance in the image below, selecting bolt_mat.004 in the material properties tab and choosing Clean Cad Mats from the Material Specials menu (which is called the Material Context menu in Blender 2.80) will replace all materials in the scene with the base name “bolt_mat” (bolt_mat.001, bolt_mat.894, etc.) with the bolt_mat.004 material.

Clean Cad Mats

As seen below, the addon works in a similar manner in Blender 2.79.

Download the latest version here.

To install the addon, download the version that works with your Blender version by right clicking the clean_cad_mats_2_xx.py file and choosing save as.

Download

3 Likes

This sounds awesome, I often run into this problem where I have about 5 chrome mats, all the same and 8 satin aluminium etc, this plugin sounds just what I need. Thanks a lot for this.

I don’t see a download link though.

Cheers, Wig

Maybe I should put one then.

edit: Okay, it’s there now. It’s also here.

1 Like

LOL yeah, would be a big help. Thanks mate.

1 Like

Thanks for this plugin. It seems that at the moment it cleans up only the selected material. It would be great to add an operator that allows to remove all duplicate materials in the scene

Edit

I found another solution, for anyone else looking. Enable material utils in preferences > addons. Then press shift + Q > Specials > Mere Base Names > select “Auto rename/replace” and the ok

image

image

1 Like