I am trying to match the Rhino materials with my own plugin materials. The RDK is not providing the material editing capacity I need, so I have a dictionary of materials, indexed by Material.Id. Unfortunately the Rhino Material.Id seems to change when you assign a material by drag-and-dropping onto geometry that already has a material assigned. I assume this is a bug? As am example, create 2 planes, assign a material to both planes (“material1”), then assign a new material (“material2”) to both planes - and this sequence create 2 copies of “materials2”, one with the Id of “material1”.
To cope if the above situation I need to capture when a Rhino material has been renamed. I am trying to use Rhino.RhinoDoc.MaterialTableEvent to do this. However the MaterialTableEventArgs.OldSettings.IsReference is always true, and MaterialTableEventArgs.OldSettings.UseCount is corrupt (usually a number > 2000000). I assume these are also bugs.
- So, if there any way to trap when a Rhino material is selected in the Rhino Material panel?
- Is there any way to determine if a MaterialTableEvent (modify) is due to a material assignment, or a material being renamed?
- Does anyone have any other suggestions I can try.
Thanks in advance.