just as a disclaimer, I'm a beginner in terms of Python scripting or programming in general, but after doing my research for such a long time, I decided to ask the experts here.
I want to change the Principled BSDF node subsurface method from the default "Random Walk" to "Random Walk (Fixed Radius)" of multiple materials of my selected object.
So instead of changing each node by hand, I decided to look for a script that finds all the principled BSDF nodes of the active object and performs the changes.
I have found multiple posts with python codes that show you how to change, for example the metallic value etc. (How to change a certain parameter of all principled shaders in my blend file?)
import bpy
for mat in bpy.data.materials:
if hasattr(mat.node_tree, "nodes"):
for node in mat.node_tree.nodes:
if node.type == 'BSDF_PRINCIPLED':
for input in node.inputs:
if input.name == 'Metallic':
input.default_value = 0.7
This works for all the inputs like roughness, alpha etc. BUT I have trouble targeting the subsurface method [Random Walk to Random Walk (Fixed Radius)].
I was hoping that I could have figured it out by myself but so far it seems it's not as straightforward as changing
if input.name == 'Metallic':
input.default_value = 0.7
to
if input.name == 'Subsurface Method':
input.default_value = 'RANDOM_WALK_FIXED_RADIUS'
The issue might be that it is not an "input" like "Metallic" but I don't know how to modify it otherwise.
Hope someone can help and even better, maybe give me a pointer on what the things are I would need to learn and understand to maybe find the solution myself.
Cheers!

node.inputs["Metallic"].default_value = 0.7. – scurest Dec 23 '21 at 04:10