RhinoScript material methods are mostly useless / obsolete

Hi @Dale,

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.

Many thanks,

–jarek

2 Likes

Hi @Jarek,

I’ll see if we can get what already exists tuned up to work better with the RDK.

https://mcneel.myjetbrains.com/youtrack/issue/RH-56284

– Dale

2 Likes

Hi @Dale,

I tested the Materials methods in the latest WIP (1/6/2020). The MaterialColor works ok, but there is still a bunch of methods that don’t work:

MaterialBump
MaterialEnvironmentMap
MaterialName
MaterialReflectiveColor
MaterialShine
MaterialTexture
MaterialTransparency
MaterialTransparencyMap

Sorry I thought it could be a global fix but probably case there each needs fixing separately?
Also, will this be 7.0 fix only, no chance of these working in V6?

Looks like @johnc is on it.

– Dale

1 Like

I am. This will be Rhino 7 only because it’s too risky to fix it in Rhino 6.

John

1 Like

Thank you John, too bad it can’t make it to V6 but understood I was late to report this!

–jarek

RH-56284 is fixed in the latest WIP