How to select a subset (list) of operations in a Composite TOP?

Hello, I’m trying to use only a certain group of operations in a Composite, a subset of the currently available (Add, Atop, …, Z Film). So I can iterate only through the operations I want with a counter (iterating through the Input Index parameter of the TOP).

for example, I would like to have available only the operations corresponding to the indexes 6, 7, 8, 9 (Chroma Difference, Color, Darker Color, Difference)

How can I do that?
I’ve tried defining a list with the indexes corresponding to the operators I want to use in a text file, but I don’t know how to export that to the Input Index parameter. I tried defining a function in a Script TOP and calling it directly in the expression field of the Input Index parameter but it does not seems to work.

Thanks in advance if you can help me with this, kind regards.

one option is to use a Limit CHOP, set its minimum to 6, maximum to 9, and type to loop.
See example:
limit_chop_in_loop.tox (718 Bytes)

hey Sergio, welcome to the forum.

If your indexes have jumps in between (for example you need index 1, 2, 3, 15, 16, 21, 23) you can try to use a counter to loop thru that list of indexes.

This can be done in a number of ways.
Using DATS, the first technique that comes to mind is using a table DAT where you specify your indexes, and a select DAT to select the index that you need.

example here.
Cycle Thru List of Indexes.toe (4.5 KB)

Click the button to cycle thru the list of indexes specified in the ‘table_indexes’ DAT.
the count CHOP is set to loop through that table, with the Limit Maximum set to the number of rows of the table. This could be handy if you decide to add to remove some indexes, the count CHOP will adjust its loop automatically (try to add or remove a row in that table, you’ll see what I mean).

If for some reason you are tight to a text DAT (ie an external file coming from somewhere else), you can always convert the text DAT to table DAT, you will see in the example attached above.

The same result can be achieved using all CHOPS, or just with a python script, but in this case using DATs I think that provides a certain readability and clarity.

I hope this helps!