I have imported multiple mesh objects into my scene and all imported mesh objects have material names inherited from the mesh name + number prefix, rather than the texture name.
I have found an excellent script here that almost works to what I want. But the script works for single selected mesh only. Batch renaming materials to texture filename, not texture name
My problem is, if I use it on several objects that are using the same mapped texture, the material will be renamed to the texture name but, if this new material name already exists, Blender adds a number suffix to the same material as the previous mesh.
I guess this is because Blender handles it as a new material and it can’t have the same name unless you manually select the original material from the dropdown in Material Properties.
Is there a way to rename the materials for all mesh objects to the name of linked textures and, in case such material already exists, can it be reassigned instead of renamed with same name + suffix, please (without texture file type extension)?
Thank you for any help in advance. Regards, Miro