1
$\begingroup$

I material nodes it is possible to use #frame as value in Value node. But when I try to do it from python API

bpy.data.node_groups['XXX'].nodes['Value'].outputs['Value'].default_value = '#frame'

I get

Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
TypeError: bpy_struct: item.attr = val: NodeSocketFloat.default_value expected a float type, not str

How can I make this work with python?

$\endgroup$

1 Answer 1

1
$\begingroup$
d = bpy.data.node_groups['WorldRandPerFrame'].nodes['Value'].outputs['Value'].driver_add('default_value')
d.driver.expression = 'frame'
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .