Material changes

Hello again,

when we get called to update a (Rhino RenderMaterial) material, for example, if the user opens the parameter editor for a colour, and starts tweaking it, we look at the RenderMaterial.RenderHash and use this to ensure that our materials are unique, yet that we can edit them again.

Unfortunately this doesn’t work, because as we click around on the colour wheel, the RenderHash is different each time, and we end up creating a new material each time, restarting our renderer.

Is there some different way we should be looking up materials, to get the desired reusability?

Using the Name field appears to be better. Can you confirm that this is unique and non-changing?

The name of a material can change (by the user), and loading in Rhino v5 files can have more than one material with the same name.


Also note that materials with different name can effectively be the same material ( same RenderHash ).

So then we are missing a unique and non-changing way to identify materials, if the name changes or the user loads a Rhino 5 scene.

When the material name changes, are we sent a message with the old and new names?

For us, a material is unique and persistent by name, regardless of what the values of the parameters are. We need some way to map from one to the other.