Rs.ObjectMaterialIndex - confusing entries/function

So -

The Help link for the method says this:

ObjectMaterialIndex Returns or an object's rendering material index.

The “or” is either wrong here, or “or changes” is what it’s supposed to read.
(there are a couple of entries like this, probably a copy/paste error)

The actual Help page says this:

Returns the material index of an object.

OK, so no actual mention of the possibility to “set” or “change” the material index of the object here…

Three: says this in its docstring for the method:

Returns or changes the material index of an object...

and it seems like the method is able to accept two arguments.

And, the following actually works - in Windows Rhino:

import rhinoscriptsyntax as rs
import scriptcontext as sc
msg="Select objects to reset to default material"
for obj in objs:

The object changes back to the default material.


This fails on MacRhino, where it tells me that I can only supply one argument to the method…

Thanks, --Mitch

Logged as a bug.

FWIW, this issue has been fixed in the latest RhinoWIP. Actually, it might have been fixed before that, but it slipped off our testing radar and I’ve only now just tested it…


should now accept multiple arguments. The snippet above does what is advertised in Rhino for Mac: resets selected objects back to the original material.