BrendanParmer / NodeToPython

Convert Blender node groups to a Python add-on
MIT License
236 stars 21 forks source link

Re-route nodes are not handled correctly. #24

Closed JeetGuhaThakurta closed 1 year ago

JeetGuhaThakurta commented 1 year ago

While using re-route node, I am getting several different types of errors. It seems re-route node is either not handled correctly or not tested extensively. The error msg varies from case to case. Sometimes it says, 4 default values are expected instead of 3, sometimes it says that a set is expected instead of float. It seems the error msg depends on the type of nodes the re-route node connects to. Not every time it throws an error. So a rigorous testing is needed with complex node trees having extensive use of reroute nodes.

We use re-route node for better formatting. So one idea can be to do away with this altogether and create a direct link between the source and the destination nodes. That is what I did for some of my projects and it worked correctly. The same thing can be automated, so the add-on won't include the re-route nodes. That is just a workaround in case the original problem cannot be fully resolved.

BrendanParmer commented 1 year ago

Hi @JeetGuhaThakurta! Sorry you were experiencing this, thanks for bringing it to my attention.

It seems like it had to do with the script trying to assign a default value to the reroute node's input. The latest commit seems to work fine on a few large node groups with many reroutes.

If you're still having troubles, could you include a sample blend file and version of Blender so I can resolve this faster? If not, just let me know I'll close the issue.

JeetGuhaThakurta commented 1 year ago

I downloaded the file you committed yesterday with the reroute node check. It did not throw any error while installing or enabling the addon (converted from my geo node tree). However, when I clicked on the menu option of the addon to add my geo node, Blender went into a hanging status. The system console did not show any details. The machine was showing a high CPU usage (some infinite loop running?) Since it was not responding, after 10 minutes I had to kill Blender. If I manually add this geo node, it works very easily and it does not take even 1 second to execute. The node is complex, but not resource heavy. I will try to debug the addon code and let you know if I get any clue.

JeetGuhaThakurta commented 1 year ago

Hi @BrendanParmer I have thoroughly checked. This particular issue regarding the Reroute node is resolved. The application is hanging because the addon is converting my node tree erroneously. It is just taking too much time. The end result is not correct, but it is not a hanging issue. Moreover, it is (probably) not related to Re-route nodes. So you can close this issue. I will probably open another issue with the wrong conversion once I clearly understand what is going wrong in the conversion.

BrendanParmer commented 1 year ago

Glad to hear the reroute issue is solved.

When you create the other issue, would you mind including a sample blend file with the node group? Nothing obvious comes to mind as to why it might be doing that