Force refresh of node

FlowCanvas Forums Support Force refresh of node

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1722
    jonathanc
    Participant

    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?

    #1724
    Gavalakis
    Keymaster

    Hello,

    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:

    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!

    Join us on Discord: https://discord.gg/97q2Rjh

    #1728
    jonathanc
    Participant

    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.

    #1729
    jonathanc
    Participant

    Nevermind! I should have used ‘i’ instead of ‘newPorts’, silly mistake, it’s working now. Thanks!

    #1732
    Gavalakis
    Keymaster

    Great!
    Thanks for the follow up. I am glad you got it working 🙂

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.