# How do I set value node to #frame using python

when adding a Value node through the geometry node tree editor I can enter #frame in the value field to have it synced up with the animation frame index (for procedural animation etc.)

However, I haven't found a way to add this kind of node with python. I was expecting to be able to do something like this:

modifier.node_group.nodes["Value"].outputs[0].default_value = "#frame"


But then I just get

TypeError: bpy_struct: item.attr = val: NodeSocketFloat.default_value expected a float type, not str


Is there any way to make use of this feature using only scripting?

import bpy

• thanks! For some reason driver_add doesn't show up in node_group.nodes["Value"].outputs[0].__dir__() so I was unable to find it Jun 26 at 8:18