I'm trying to understand the many features AN has developed over normal node api and by reading the code I realize that if you need to be notified of a property change with the classical update hooked to a function call it needs to be declared as normal blender property and there is no way to get update notification with sockets data? For example:
import bpy from bpy.props import * from ... base_types.node import AnimationNode class TestNode(bpy.types.Node, AnimationNode): bl_idname = "an_TestNode" bl_label = "Test node" def runUpdate(self, context): #this never get's called by run2 update print("update ", self.run1) #print("update ", self.run2 ) #<---- this error not sure how to get it def draw(self, layout): layout.prop(self, "run1") run1 = BoolProperty(name = "run1", default = False, update = runUpdate) def create(self): self.newInput("Boolean", "run2", "run2", update=self.runUpdate, value = False) def execute(self,run2): if run2: print("RUN 1 ", self.run1) print("RUN 2 ", run2)
In this example the only way (I know) to get run2 value is with the main execute function and update=self.runUpdate never get called.
Also I noticed all the time blender props get hooked to events.propertyChanged / executionCodeChanged etc and/or the function calls createSockets() with @keepNodeState decorator and inside this function the sockets get declared. can someone tell me if I got it right and how is supposed to work to get notified if a value in the socket change and in general what is the correct way to take advantage of these events?