I want to access to my geometry on the “OnCreated” event of my HDA. But it doesn't work on this event but work on the PythonModule (script function call with a button) ??
Here is the log for the same code : - OnCreated event log :
Ok, As I understand, it seems that on this “OnCreated” event, my new created hda node isn't yet connected. That's why I can't get geometry() from my current new node and of course, it isn't cooked.
I don't see any event on the list that match my need (= “OnCreated” + just connected) . Did I miss something or do you know a workaround ?
As a workaround to simulate a “OnCreated” + just connected event : I use the “OnInputChanged” event, and use an invisible toggle parameter to make sure I execute my operation once.
createdHdaNode = kwargs
thisIsTheFirstConnection = createdHdaNode.evalParm(“neverConnectedBefore”) if thisIsTheFirstConnection : #set parameter to false to never execute again this operation createdHdaNode.setParms({“neverConnectedBefore”: 0})
#some stuff #…. I'm not sure if it's the best solution but it works and it's relatively easy to set up.