I am trying to do a material study, and I would like to print the Principled BDSF values onto the render.
Previously I had found this: How to show render-stamp for arbitrary values?
It had worked, but the data path I get when I right click the roughness parameter for the Principled BDSF is:
nodes["Principled BSDF"].inputs[7].default_value
That doesn't seem to work the same way.
here is the script:
import bpy
def stamp_set(scene):
note = "Samples: " + str(scene.cycles.samples)
note += ", Bounces, Max: " + str(scene.cycles.max_bounces)
note += ", roughness: " + str(nodes["Principled BSDF"].inputs[7].default_value)
note += ", Version: " + bpy.app.version_string
scene.render.stamp_note_text = note
bpy.app.handlers.render_pre.append(stamp_set)
I also tried, cycles.nodes["Principled BSDF"].inputs[7].default_value
and
scene.nodes["Principled BSDF"].inputs[7].default_value
I get an error in the terminal that these are undefined (I think).
SO, how would I go about doing this?
thanks,
eh five