I have a Material that consists of a single Node Group; one of the Node Group inputs is a scalar value named Spot Z Rot.
I'd like to add a driver to the Z rotation of an object, forcing it to match the Z Rot of this Node Group input. However, when I try to do this in various ways, the property is not recognized. I am able to access Spot Z Rot from the general scripting interface:
But when I try to do something similar in the Add Driver menu, Spot Z Rot is not recognized as a valid property of the Material:
So far I have tried, without success, the following:
bpy.data.node_groups['ToonShader'].inputs['Spot Z Rot']
data.node_groups['ToonShader'].inputs['Spot Z Rot']
node_groups['ToonShader'].inputs['Spot Z Rot']
self.inputs['Spot Z Rot']
As well as driving the rotation from an added custom property on the material. The driver does not seem to recognize any of these variables.
Is there a correct way of accessing a Material's Node Group Inputs from a Scripted Expression Python Driver on an object?
EDIT: Actually(Actually, even in the general Python scripting interface, I only seem to be able towas a bit confused; Getting the actual (not default) input value of a node group for a specific user clarifies how access or set the min, max, or default valuesshould work, but node_tree.nodes.get('ToonShader').inputs['Spot Z Rot'].default_value
does not work in the current value, so I suppose I am missing something fundamental about how to access or alter these values from a script:Driver either.)
>>> dir(bpy.data.node_groups['ToonShader'].inputs['Spot Z Rot'])
['__doc__', '__module__', '__slots__', 'bl_rna', 'bl_socket_idname', 'default_value', 'draw', 'draw_color', 'identifier', 'is_output', 'max_value', 'min_value', 'name', 'rna_type', 'type']