Wish: Global Material Replacement

In Rhino 8, would it be possible to add a command to global replace materials in a model?

That feature is for material organizing in large projects, since after merging models from different sources, there may be several duplicate materials.
I tried to script and posted this a year ago, but it doesn’t work as I wish. This script can’t replace materials assigned to layers and nested blocks. In large projects the script will cost minutes.

https://discourse.mcneel.com/t/global-material-replacement-script-get-material-of-subobject-in-blocks/144185

1 Like

Hello- RenderMergeIdenticalMaterials should help with the duplicates.

-Pascal

3 Likes

This command is useful when several materials share identical settings.
But there is another more common scenario: suppose in an architectural design project, I need to obtain a part of the model for a certain project from five different colleagues to assemble a complete project model. Without reliable project material management, the merged model may have five different window glass materials with subtle transparency differences and five flooring materials with subtle color differences. These materials are assigned to nested components or layers. In this case, I would need a significant amount of effort to integrate the materials. Therefore, the best approach is to use a command that can globally categorize and merge materials.

This seems to me the shortest route to happiness here. I understand the request, and I’ll make a bug track item for the developers, but practically speaking, sorting out the materials among your colleagues may be a faster route, unless it turns out there is something simple I am overlooking or forgetting.

@Miracle_arc -would a reasonably workflow be: make a multi-selection from all the materials in the file, then make a single selection from the same list, and apply the last to all of the objects that have materials from the first selection. Are the replaced materials removed or only replaced on the objects?

-Pascal

Yes, comprehensive material management is the ultimate solution. However, the situations I mentioned above have been encountered many times in practical projects I have experienced. I believe this is also why Vray and UE4 provide a similar global material replacement command.

https://discourse.mcneel.com/t/how-to-replace-material-in-rhino-similar-as-the-use-as-replacement-function-in-vray/79921

Here how it works at V-Ray for Rhino - the user select a material A and choose “Use As Replacement” and than he select the materials he want to remove and here he choose “Replace All References”. Now, all materials got material A. Maybe something for the Rhino material workflow too.

image

1 Like

Better material management is really needed for big architectural models/projects. It’s going out of control for me. I’m frantically searching for some good ways to manage materials, but it doesn’t seem to exist (Filters is just more work - it also doesn’t solve so many duplicates and long material list after importing a lot of objects)

1 Like

_RenderMergeIdenticalMaterials

It doesn’t work if two materials are ever so slightly different and with very slightly different names from different projects. Once several projects/objects are put together, the material panel is just a mess.

It would be a huge help if McNeel would make some changes for bigger/complex projects and models.

if two materials are slightly different (regardless of name) then they are not identical nor duplicate materials, which is what you mentioned in your post.

But you can select multiple materials in the material editor, use Select Objects from the context menu, then select another material and select Assign Material.

The other way around you could select all the objects you want to have the material replaced with and just Assign Material? Once done purge unused materials and your list should be much more manageable?

Anyway, I think @maxsoder can probably tell more on how something like the workflow mentioned in Wish: Global Material Replacement - #6 by Micha could be done.

Overall, it becomes too much of a mess once you import and merge a lot of projects/objects. Until there’s a more comprehensive project material management, I wish I could at least bulk-add a prefix to material names so that the material list is organized. If I try that, it erases the original material name and just adds #s behind.

I think the replace material feature described here that VRay has could be a useful. Or something similar.