Closed Quaggles closed 3 weeks ago
Good job! I think I'll merge your PR into another branch and make a few changes like adding a call to original onConnectionsChange
and making new inputs optional (making Add Region
/Remove Region
buttons completely obsolete).
I've pushed changes to master branch and updated readme. Input management is now completely automatic - no buttons required. @Quaggles, can you please check if everything works for you?
Yep works for my API usage, thanks
When using AttentionCouplePPM through a workflow API added regions (cond# and mask#) aren't connected (Try loading this workflow to see the issue: AttentionCouple_PPM_API.json).
This seems to be because extra region inputs are currently only added with the
Add Region
button in the context menu, since the API workflow spawns the node and tries to connect the inputs it doesn't know about the additional inputs so it fails to connect them. Other custom nodes seem to handle this situation by subscribing tonodeType.prototype.onConnectionsChange
then using that to automatically add the extra input slots when the previous ones have been connected.This pull request adds that functionality, when
model
andbase_mask
are connected it will automatically addcond_1
andmask_1
inputs (As if you clicked add region), then if those are linked it will automatically createcond_2
andmask_2
, and so on. The existing add and remove region buttons still work and the attached API workflow json will now load.