I am trying to add a driver in a node entry in the World. The following script fail with "TypeError: bpy_struct.driver_add(): property "inputs" not animatable " I can't find sample of similar code. Any help?

import bpy
scn = bpy.context.scene

wd = scn.world
nodes = wd.node_tree.nodes

DR1 = nodes.new('ShaderNodeMath')
drv = DR1.driver_add("inputs",0)

Drive the default_value property of a particular input channel.

>>> n = C.scene.world.node_tree.nodes.new("ShaderNodeMath")
>>> d = n.inputs[0].driver_add("default_value")

>>> d.driver.expression

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.