I copied full datapath for my property Vertices X as shown below and set it via python using bpy.data.objects["Cube"].modifiers["GeometryNodes"]["Socket_2"] = 5
. The value will update when you hover over it but it does not update the 3D View evidenced in the GN tree socket value it's still 2 instead of 5. Why? I found this thread but no answer. Is this a bug?
I also tried context.view_layer.update()
but that didn't help...
I noticed that when I manually toggle back and forth it works but if I do it with script it doesn't:
bpy.data.objects["Cube"].modifiers["GeometryNodes"]["Socket_2"] = 5
bpy.ops.object.mode_set_toggle()
bpy.ops.object.mode_set_toggle()
I also found this answer and tried this:
dg = bpy.context.evaluated_depsgraph_get()
dg.update()
But that also doesn't work. Is this maybe a bug I should log?