I’ve created a custom material (Rhino.Render.RenderMaterial) with different parameters added to Rhino UI like this:
var reflectance_field = Fields.Add(REFLECTANCE_COLOR_FIELD, my_Color4f, "Reflectance Color"); //Rhino.Render BindParameterToField(REFLECTANCE_COLOR_FIELD, reflectance_field, ChangeContexts.UI); //Rhino.Render.RenderContent
With this parameters I haven’t any problem, Rhino saves and loads it flawlessly from the rtml file…
I have also a custom ComboBox (Windows.Forms.UserControl) with an array of strings, the idea is take the selected string and save it with the other fields in a rmtl file. The problem is how to read back the stored value and show it in the ComboBox.
By creating a Field with:
Fields.Add("material", Material); //string
and setting its value when the combo changes I wrote my value in the file but I can’t read it. I tried to use the RenderContent.GetParameter(“material”) function, but it didn’t work… Can you help me?