Issue with isValidConnection and Handling Same Handle Types in Custom Nodes #1744
Closed
Jarvis-Liu
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
|
You can set |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I’ve encountered an issue with the
isValidConnectionimplementation while working with custom nodes. Here’s the scenario:type: 'source'andtype: 'target'respectively.sourcetosource) can be connected. However, my intention is to allow onlysourceto connect totarget, similar to the behavior in the official demo withnodeType: 'default'. In the demo, if you try to connectsourcetosource, the connection automatically redirects to the correcttargethandle.I’m confused about why this behavior works seamlessly with
nodeType: 'default'but not in my custom implementation. To address this, I attempted to useisValidConnectionto validate the connection based on the handle types. However, I noticed that theconnectionparameter only provides thehandleIDs, not their types. This forces me to look up the handle types by searching through the original data using thehandleIDs, which feels overly cumbersome for a simple validation.Questions/Suggestions
connectionparameter to includesourceHandleTypeandtargetHandleType? This would make it much easier to validate connections without needing to manually maphandleIDs to their types.isValidConnectionincorrectly? Is there a more straightforward way to enforcesource-to-targetconnections without resorting to manual lookups?Any guidance or clarification on this would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions