The mMaterial component I posted two days ago, using C# found on this forum, offers more parameters that are useful for creating a material and can easily support more properties defined for the class, such as ‘IndexOfRefraction’.
https://developer.rhino3d.com/api/RhinoCommon/html/T_Rhino_DocObjects_Material.htm
Demo:
mMaterial_2020Jan14a.gh (46.4 KB)
Properties currently implemented:
- DiffuseColor
- AmbientColor
- EmissionColor
- ReflectionColor
- Reflectivity
- ReflectionGlossiness
- Transparency
And as I said before, why must I become dependent on a plugin for a basic, low level capability like this that should be built into Grasshopper?
As noted, encapsulating the C# code in a cluster allows two big improvements:
- I can rename the output to match the geometry, which isn’t possible on a C# or Python script component.
- I can edit the cluster and delete inputs that I don’t need to make the cluster footprint smaller on the canvas.