-
Notifications
You must be signed in to change notification settings - Fork 727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inputs are not updated before actions #66
Comments
Yes, this is a problem of the current architecture. Nodes onExecute is executed constantly (when the runStep method is called for the graph), but onAction is executed when the event is triggered, and it propagates, but it only calls onAction, not onExecute. This means that there are two separate flows of execution, the constant onExecute (the data flow) and the propagated from an event (the event flow). So if you want to blend data using both simultaneously you will have to run the whole graph before triggering the event, which is not very efficient (all nodes will be executed) but it would solve the problem: node.onAction = function(event,param){
this.setOutputData(0,"data")
this.graph.runStep(); //make that data flow
this.trigger(0); //trigger event
} Let me know if that works for you |
Its unfortunate that the flow separates. I would have assumed getInputData would have forced a fetch if required, but I suppose there is no easy way to do that. I have tried the |
I will research on the topic this week, I could create a function that executes from Node triggering the event to the node receiving the event. Ask me about it in one week |
That could be done, but fetching the input data from a previous node wouldnt solve it if that data passes through several nodes. The only solution is to force the data to flow between two nodes. |
I have a early stage solution for this, currently in debug but promising. Just for triggered/actioned nodes, I'm calling a refreshAncestors function that read the ancestors tree and execute the nodes, ensuring that all the data needed is updated. There are some checks to prevent recursions and double-execution. |
Was this ever implemented? It would be interesting to be able to execute backwards the inputs of the event nodes, so that they can get fresh values without needing to run the entire tree. From what I understand, that's what Blueprints does. In the end most javascript applications will be more event-based than frame-based |
The input data of connected nodes are not updated until after the onAction event. I have even tried moving the trigger to after I set the output data of the node.
Lachee Console Node
On Message Node
The text was updated successfully, but these errors were encountered: