I have a special case, where I would like a class that extends FlowControlNode, and it has some logic that as things happen to it, it would like to add new value and flow “output” ports, but I can’t seem to figure out how to get that to appear visually. Is there a this.refresh(); method or something I’m missing?
Refreshing a node can be done with a call to this.GatherPorts().
The node will then simply re-gather the ports that you tell it to add within the RegisterPorts method callback.
All AddPort calls (like AddValueOutput, AddFlowOutput etc), should better be done within that RegisterPorts method callback, but of course based on some variable checks for example for options, you could chose to add a port or not, like for example:
1
2
3
4
5
6
7
8
9
10
publicbooloption;
protectedoverrideRegisterPorts(){
if(option==true){
AddFlowOutput("Out);
}
}
Let me know if that helps, but if not, please provide me a bit more information on what you want to achieve more specifically so that I can provide a better suited solution if possible 🙂
Thanks!
Thanks, it is starting me in the right direction, I notice a refresh now, but I can only seem to add one, in my loop I expected to add an extra one each time I connect a new port.