Python: How to assign attributes to existing objects?

@andy, i’ve now invested one hour to find out how to disable the diffuse lightning toggle in a material with no result. Is this possible at all ?

I’ve created a rhino material, got its index, then created a basic render material using

rh_mat = scriptcontext.doc.Materials[index]
render_mat = Rhino.Render.RenderMaterial.CreateBasicMaterial(rh_mat)

next i found out this string:

some_string = render_mat.BasicMaterialParameterNames.DisableLighting

and tried to use it:

context = Rhino.Render.RenderContent.ChangeContexts.UI
rc = render_mat.SetParameter("diffuse-lighting", False, context)

however, rc is always False. I wonder if there is a way to access all these default UI elements in V6 and i am getting quite confused when dealing with materials, rendermaterials, child slots, child slot names, parameters, fields etc. Is there an easy way to add a material in Rhino via python which is visually equivalent to a picture frame, so it just has a texture and no diffuse lightning ? I guess this is what @Michael_Meyer is trying to do.

c.