How to hook in arguement in a Delegate

So delegate demo
trying to add another switch and a delegate region, how do I create the inputs/outputs and hook into the argument pin.
Theres no clicking or key+clicking that seems to bring up anything helpful, a quick skim of the grey book seemed no to help either…

you have two ways to create a suitable delegate:

  • automatic: start a link from the Switch input and then middleclick: voila
  • manual: create a Delegate via nodebrowser as you did and then add an “Input” and an “Output” via nodebrowser manually

Easy when you know that an iobox is no longer an iobox…
And if I wanted more than 1 argument, is that possible?

regarding more inputs: yes. note, that the number is dictated by the Invoke node that has a signature of 1 -> 1 meaning: one input to one output. while the number of outputs is fixed to 1 you can choose a different Invoke, eg with 3 -> 1 and then also add those additional inputs to your delegates. makes sense?

Ok that seems to work, once I found the node version rather than the regions, what are the region Invokes for/how are they used/different?

short answer: ignore the region versions of invoke.

long answer: any node that has a delegate input can also be created as a region, that comes without the delegate input pin and instead just allows to patch the delegate in-place, right in that region. This makes sense for many nodes that come with tweakable functionality like Sort (Comparer) [Spread], Project (Many) [Spread], Resize [Spread], Where [Spread]…
So the system tests for delegate inputs, and if any, allows to create the node as region.

In case of the invoke we could think of suppressing that feature, since we lack an example for a case where you want to invoke a functionality that you define in-place. It isn’t really adding anything useful. Just a border around some nodes, that are invoked the same way as if the border would not exist.

This is roughly comparable to a plain code block in c#
http://stackoverflow.com/questions/6136853/why-does-c-sharp-allow-code-blocks-without-a-preceding-statement
In theory they may have their applications but for now they are more confusing then helping.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.