Hi All,
in a Grasshopper Python Component I would like to get a list of all materials in the document to read their RGB values. My materials are Vray materials. There are no Rhino materials present in the file. I cannot use Rhino materials for this.
Rhino Version 6 SR26
Vray Version 3.60.03
I tried so far:
-
scriptcontext.doc.Materials
-> not supported in GH -
Rhino.RhinoDoc.ActiveDoc.Materials
-> Holds the same number of materials as listed in the Vray Asset Editor UI. So I assume those are the Vray materials. But allRhino.RhinoDoc.ActiveDoc.Materials[i].DiffuseColor
values are unrelated to the actual values set up in the Vray materials. -
Rhino.RhinoDoc.ActiveDoc.RenderMaterials
-> is empty - I applied the Vray materials in Rhino to Brep objects. Loaded those objects into GH as Geometry and use them inside the GH Python Component to do
rhinoscriptsyntax.ObjectMaterialIndex(guid)
-> always gives me -1. This works in normal Rhino Python Scripts, but not in the GH Python component.
I know @clement did some work in this direction with Python Script. Did you ever get it to work in GH Python?
Any ideas are greatly appreciated. Thanks for your help.
Silvan
4 posts - 3 participants