Hi @Timothy_Peoples, below works fine in Rhino 7 but fails in Rhino 8:
context = Rhino.Render.RenderContent.ChangeContexts.Program
rm.BeginChange(context)
rm.SetParameter("pbr-bump-amount", 45)
rm.EndChange()
Edit: btw. if you create this PhysicallyBased material from scratch you’ll need to enable the displacement / bump UI section as well. See this post for more information. The best way to find out about the used parameter names is to create a material in the material browser then save it as rmtl file and look inside the xml structure…
@johnc, i think Rhino 8 has a bug. To repeat it, please create a new document with only one physically based material with a bump slot, then run this script:
import Rhino
import scriptcontext
import rhinoscriptsyntax as rs
def DoSomething():
renderMat = list(scriptcontext.doc.RenderMaterials)[0]
print "Before:", renderMat.GetParameter("pbr-bump-amount").ToDouble(None)
context = Rhino.Render.RenderContent.ChangeContexts.Program
renderMat.SetParameter("pbr-bump-amount", 42, context)
print "After:", renderMat.GetParameter("pbr-bump-amount").ToDouble(None)
DoSomething()
It seems the value get/set works properly but the UI does not reflect it. (i’ve tried various different context values).
_
c.