Change gamma from python

Hello!
How can I change material’s gamma from python script?
image
Thank you!

@andy, @nathanletwory - is this something you can help with?

You can change parameters on RenderContent using the GetParameter() and SetParameter() API. This works for RenderMaterial, RenderTexture and RenderEnvironment.

To find out what the parameter name is you do that easiest by saving your (top) render content as a file. Simplest is by dragging the material or environment to the Windows file explorer. Then open the resulting .rtml file in your favourite text editor and search for the parameter name. If you have a hard time guessing what the name could be just set a special value you can search for, say 99.99. Do the search and take note of the parameter name.

variant = rc.GetParameter(yourparameternamehere)
print(variant.ToDouble(None)) # or ToBoolean, ToSingle, ToUInt64 etc. use dir(variant) to find out what the possibilities are

To change:

rc.BeginChange(Rhino.Render.RenderContent.ChangeContexts.Program)
rc.SetParameter(parametername, 4.4)
rc.EndChange()

Here a short video if the text alone wasn’t clear enough

Thank you!