You are probably aware of this but most of the RhinoScript methods that deal with material modifications are not working properly with current Rhino 6 materials. Even though some methods “seem” to work, it is not being retained.
Example: make a box, assign custom material to it.
Run this script:
Dim o : o = Rhino.GetObject() Dim i: i = Rhino.ObjectMaterialIndex(o) Call Rhino.MaterialColor(i, vbRed)
It will change the color of the object to red. Ok, but not in Material Editor, plus once you save and re-open the file, the change is not remembered. I was recently trying to batch-change materials to use different folder for material texture maps, and same happens - the change is not retained. There are probably more examples I could come up with but the root of the “problem” must be the same - which is how materials are being coded in Rhino now vs. how the old RhinoScript methods are trying to handle them.
I can get things done via using RhinoScript RDK methods but it is much more cryptic, even though it offers access to many more attributes than RhinoScript methods.
But in general it should be noted that these don’t work anymore and I would suggest removing them from RhinoScript, or better yet, making them work with the new material system.