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?
My main objective is to read a custom parameter from any RTML file. I saw that the RTML file which Rhino creates when you export a material is a simple XML file. This XML contains a section called “Parameters” where are stored the parameters of the material. I have put a RTML file sample in pastebin, note the commented line that it’s the parameter I want to read:
I’m sorry, I still don’t understand what you mean. If you want to read a value out of any RMTL file, then you’ve already answered your own question - use an XML parser to get at the node.
Or - if you want to get at parameters on the live RenderMaterial (ie - after the RMTL has been loaded into the material editor) use RenderContent.GetParameter.