DearPyGui icon indicating copy to clipboard operation
DearPyGui copied to clipboard

Preventing Infinite Loop in Node Editor

Open Akascape opened this issue 9 months ago • 2 comments

In the Node Editor, suppose we have node A and node B, If I connect node A's output to node B's input, and then connect node B's output back to node A's input, it creates a loop that causes the entire application to hang. Is there a way to prevent this in the Dear PyGui node editor. We have to delink the previous connection if there any reverse link case.

Example: Image

Akascape avatar Mar 11 '25 16:03 Akascape

If I remember correctly, the links are created by your own code, not by DPG. That's where you can check if the new link creates a loop and delete old links as necessary. Take a look at the node_editor's callback argument.

v-ein avatar Mar 11 '25 20:03 v-ein

Please don't click the link in the notification you received for the previous comment. It's a scam.

v-ein avatar Apr 16 '25 18:04 v-ein