Sketchup Material Suffix Removal

Hello and Good Morning, I was wondering if anyone may be able to help me with an issue I am having.

I am currently in the process of going through all my workplaces materials and models to remove duplicate materials and tidy them up in order to more effectively use them within rendering programs such as D5Render. One of the most time consuming aspects is simply going through the materials trying to find duplicates with Suffix’s, i.e:

Concrete Block 8x8 Gray (original material)
Concrete Block 8x8 Gray1 (Suffix)
Concrete Block 8x8 Gray#1 (Suffix)
Concrete Block 8x8 Gray_1 (Suffix)

I’d like a quick easy way to merge these suffix variants into the original material name. There is no consequence for me regarding the materials properties as long as the match the original materials aspects.

I attempted Cleanup3 but it merges names with a wide range of variants, making it unreliable for what I need.

It would merge these 2 materials together:

Rose 4 Pantone 494 (81RR 47/323) (0% Matt)
Rose 4 Pantone 494 (81RR 47/323) (50% Semi Gloss)

If anyone can help me with this it would be much appreciated,
Kind Regards,

I’m not sure why Cleanup3 fails to do what you want, largely because I have no way to know the details of the materials it merges when you didn’t want it to do so. Looking at the code, Cleanup3 compares the following aspects of materials to find matches:

  • RGB color
  • alpha
  • material type (solid, colorized, textured)

If the material has a texture image, it also compares:

  • texture filename
  • texture width (i.e. the model width the image maps to)
  • texture height (i.e. the model height the image maps to)
  • texture image width (pixels)
  • texture image height (pixels)

There is also a toggle to determine whether to compare attribute dictionaries of the materials. If this is on, materials with different attributes won’t merge despite being otherwise identical.

There are additional properties of the material that are not compared, and might explain some of the issues you are seeing, depending on when and how the materials were created:

  • colorize type (as of 2015)
  • colorize deltas (as of 2015)
  • owner type (as of 2019.2)
1 Like