Hi everyone,
I’m writing a component in C# for rendermaterial output, but I can’t seem to find the correct parameters for the output, can you help me?
protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
{
pManager.AddGenericParameter("renderMaterial", "Material", "output renderMaterial", GH_ParamAccess.item); //---BUGGGGGGG-----
}
double Reflection = 0.3;
double Smoothness = 0.1;
Reflection = Math.Min(Math.Max(Reflection, 0), 1);
Smoothness = Math.Min(Math.Max(Smoothness, 0), 1);
Rhino.DocObjects.Material material = new Rhino.DocObjects.Material();
//material.SetBitmapTexture(fileName);
material.ReflectionColor = cor;
material.DiffuseColor = cor;
material.AmbientColor = System.Drawing.Color.Black;
material.EmissionColor = System.Drawing.Color.Black;
material.Reflectivity = Reflection;
material.ReflectionGlossiness = Smoothness;
Rhino.Render.RenderMaterial renderMaterial = Rhino.Render.RenderMaterial.CreateBasicMaterial(material);
DA.SetData(0, renderMaterial);