How to avoid duplicate materials when copy-ing objects with the same material name from one file to another?

When copying objects with materials from one file to another (aka efficiently using a library of objects), a duplicate of every material is created if it already exists so you will end up with ‘glas’ and ‘glas01’, ‘wood white’ and ‘wood white 01’ etc.

Is there a way to avoid this and just have SketchUp use the existing material for the newly inserted objects if it already exists?

It depends on whether the materials are edited, check the attributes inspector if some render extension has added a dictionary.

So you’re saying that if 2 materials have the same name but have slightly different internal values (for instance a different hue), a copy is made? Makes sense.

You might give the Merge Materials feature of ThomThom’s CleanUp3 or TIG’s Material Consolidator to see if they reduce the number of materials. In the case of the latter one you can have it consolidate materials that are close in RGB values which might be useful.

If the material has been edited and does not match, a new material needs to be added, otherwise the object you paste wouldn’t match the one you copied.

If the materials perfectly match, this is a bug.

For how long have you seen this?

thanks for the suggestions.

Will keep a lookout for this ‘feature’ the next time I notice it. I think this is happening for a year now - not sure though.I do know I didn’t have this problems a few years ago (I made some plugins a few years ago that insert components with textures and this problem didn’t happen when I developed those plugins).