Module Index Internal Parameter

Fri Jan 04, 2019 6:25 pm

What do you think of having an 'Internals' feature that provides the Index of a module based on the position of its output noodle into the next module or its input noodle from the previous module.

Simple use case: a (say polygon) module is connected to 10 transform modules each of which could use its index to position itself automatically.
Extended use case: use the Index in the expression modifier for a wide range of effects.

In addition to these simple use cases, this would open up the possibility for the following...

Instance.jpg
Instance.jpg (28.75 KiB) Viewed 721 times

A single module could be virtually instanced, adding input and/or output connectors as required e.g allow a single transform to have 10 inputs and 10 outputs each, where the input and output indexes are available to the parameters and modifiers are applied to each instance. In the mock-up image above, the first input would be scaled on X to 0.1 and sent to the first output, the second 0.2 and so on, thereby having 10 images progressively stretching in the X dimension. Could be used like an Array module but much more powerful.

One could also imagine chaining these instance modules together e.g. 10 into 10 or 10 in 5 and another 5. Many possibilities.
Sadler
 
Posts: 575
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Module Index Internal Parameter

Fri Jan 04, 2019 6:58 pm

What an excellent idea!
artnik
 
Posts: 263
Joined: Tue Jan 05, 2016 5:33 pm

Re: Module Index Internal Parameter

Fri Jan 04, 2019 8:25 pm

Yes, a very good idea, thanks ;) .
Eric
Site Admin
 
Posts: 2529
Joined: Wed Apr 09, 2014 9:28 pm

Re: Module Index Internal Parameter

Sat Jan 05, 2019 2:47 pm

This looks very useful :D

The instance count need not be explicit and a "Multi-instance" checkbox would be sufficient. Outputs could be added to match the actual number of input noodles, which would nicely match the way in which input pins are added.
Terry Payman
 
Posts: 522
Joined: Sun Sep 14, 2014 8:15 am
Location: UK

Re: Module Index Internal Parameter

Sat Jan 05, 2019 8:43 pm

Imagine a single polygon piped into a translate and then output to an input selector. If there was only a check-box to declare the translate multi-instance there would be no way for it to know how many instances were required. If, however, the translate grew a few input nodules, the single polygon could be attached to each.
Sadler
 
Posts: 575
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Module Index Internal Parameter

Sat Jan 05, 2019 9:09 pm

Ah yes! I hadn't fully appreciated the versatility of your idea. :oops:

However, perhaps my proposal could still work:

Suppose that, when "Multi-instance" was checked, the output pin count behaved equivalently to the input pin count. An additional output pin is added as soon as one adds a noodle to an existing output pin. The actual number of active instances could be shown adjacent to the checkbox, to save counting them when very many are used.

EDIT: I feel I'm still missing something here :?
Terry Payman
 
Posts: 522
Joined: Sun Sep 14, 2014 8:15 am
Location: UK

Re: Module Index Internal Parameter

Sun Jan 06, 2019 11:00 am

If Eric chooses to implement the index internal parameter, that's relatively straightforward I think. If Eric chooses to implement the instancing, I trust that he will choose the most powerful, functional way to do it without breaking the UI/UX.

For the sake of discussion, picture this: an arguably not very functional but somewhat illustrative edge case is to have a single module connected to the Magic module. There would be no input pins and only one output pin. If the module had one additional unconnected pin, this could be connected to create additional instances. Each time an additional output pin was connected, a new unconnected pin would be made available. Modules already do this for input pins. Is this what you're missing Terry?

This brings up another potential feature that might be more necessary/logical with instancing but more disruptive to the current application. Right now, if a module is split into a number of paths, the same frame from that module is copied to each path. There is no way, for example, to send a 3 then 4 then 5 sided polygon from a single module - you need three polygon modules each with different parameters. Having the Index respected in an instanced module would allow each instance to be different using the Index but you'd also want to respect different random seeds, for example, and other ways to differentiate instances somehow.

The :evil: is in the detail and I respect that Eric has these and many other details to contend with when considering new features.
Sadler
 
Posts: 575
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Module Index Internal Parameter

Sun Jan 06, 2019 2:39 pm

a great idea !
damstraversaz
 
Posts: 148
Joined: Tue Aug 26, 2014 11:22 am

Re: Module Index Internal Parameter

Sun Jan 06, 2019 4:42 pm

Yes, just the Index parameter by itself will be fairly simple. Anything beyond that will require more careful consideration.
Eric
Site Admin
 
Posts: 2529
Joined: Wed Apr 09, 2014 9:28 pm

Re: Module Index Internal Parameter

Wed Jan 09, 2019 12:03 am

@Eric I'd given this matter some consideration offline so I'm adding these thoughts belatedly in case they can contribute. Sadler may wish to differ, but here's my penny's worth:

- Multi-instancing could be enabled by a module menu option, regardless of how the instance count is determined.

- When multi-instance is enabled the module could have brackets after the module name, perhaps including the input and output pin counts eg Scale [5:5] or Translate [1:8]. Neatly, this would appear on the module's title bar from which the option had been enabled.

- I think Sadler and I envisage that the output pins would behave similarly to the input pins. (See my comments to Sadler below).
"Each time an additional output pin was connected, a new unconnected pin would be made available" - Sadler

- I think the instance count need not be entered explicitly, but could be determined by enumerating the connected inputs and outputs. Also it seems safer to work from the actual number of connected inputs/outputs rather than considering possible consequences of a mismatch between the number of connections and an explicitly requested number of instances.

- I now think this enumeration could eliminate the need for any Multi-instance checkbox (or numeric-entry) box. Multi-instance is enabled by the menu, and activated when more than one input, or more than one output is connected.

- If input-vs-output constraints (such as one-vs-many , equal-vs-equal, many-vs-one) are needed for simplicity of implementation, these options could be offered by a combo-box. Instance count is then simply the greater of the input and output counts and one instance-index is arguably sufficient. In cases other than the above there would need be two indexes, as mentioned by Sadler: "A single module could be virtually instanced, adding input and/or output connectors as required ... where the input and output indexes are available to the parameters and modifiers are applied to each instance"

- Some annotation could be helpful reminders of the highest index number(s), and perhaps sufficient to show that multiple instances were active.
eg (0...4) on the input side and (0...4) on the output side for module having 5 inputs & 5 outputs.

- I'd be happy with just the Transforms in an initial implementation, although I'd have found use for multi-instance HueSaturation when making my projector test chart.

@Sadler yours is a great idea but a bit too great to fit entirely into my head! :)
Thanks for your recent response, but I'm still a little puzzled by part of it:
Sadler wrote: ... If the module had one additional unconnected pin, this could be connected to create additional instances. Each time an additional output pin was connected, a new unconnected pin would be made available. Modules already do this for input pins. Is this what you're missing Terry?

Well, that's not what I was missing, indeed it's what I was proposing when I wrote
Terry wrote: Suppose that, when "Multi-instance" was checked, the output pin count behaved equivalently to the input pin count. An additional output pin is added as soon as one adds a noodle to an existing output pin.

Here we seem to be in agreement, but I may well be missing something else.

Too heavy for me to lift! Happy to leave it to Eric!
Terry Payman
 
Posts: 522
Joined: Sun Sep 14, 2014 8:15 am
Location: UK

Re: Module Index Internal Parameter

Wed Jan 09, 2019 1:04 pm

The more I think about this idea the more excited I get about the possibilities. This will make it possible to make "follow the leader" / chained objects, similar to the Hypnoworm ISF https://www.interactiveshaderformat.com/sketches/1655 pretty easily using a combination of transforms and delay. Also, tunnels composed of 3D objects. :-)
artnik
 
Posts: 263
Joined: Tue Jan 05, 2016 5:33 pm

Re: Module Index Internal Parameter

Mon Jan 14, 2019 11:41 pm

A brilliant suggestion!
spacedoctor
 
Posts: 30
Joined: Sat Sep 06, 2014 9:44 pm

Return to Feature Requests

© 2019 Color & Music, LLC • This web site is mobile-friendly