Docs Developer
SeqMod
Watches a sequence of parameters on any COMP: name the target and the sequence, and the block parameters are published as one list, with a callback for every block added or removed.
⌨ Developer ◆ Patreon · Base
Why use it
Sequence parameters, the Items0name, Items1name, ... blocks TouchDesigner
grows and shrinks, are awkward to drive from outside. The names change with
the count, and nothing tells you when a block appears. Build a control panel
with a row per block of another COMP's sequence, and you need both: the
current list of block parameters, and a signal when one is added or removed.
SeqMod sits beside the COMP that owns the sequence and keeps that list
current. It publishes the block parameters as ParNames and as a table on
out1, and fires a callback for every block added or removed. Wire it to a
replicator, a UI builder or your own script and the sequence becomes something
you can react to.
Features
- Follow a sequence's blocksPoint it at a COMP and name the sequence, and the list of block parameters stays current as the sequence grows and shrinks.
- Publish the block parametersPublishes the block parameters as name patterns in ParNames and as a table on out1, ready for a Parameter DAT, a UI builder or a script.
- Add and remove callbacksCreate Callbacks makes a DAT whose OnAddBlock and OnRemoveBlock hooks run once per block; errors are reported on SeqMod itself.
How to use it
- Create it from the FNS tab of the OP Create dialog, where it is called Seq Mod. It is a member of the FNS operator family and lands as one node.
- Set COMP to the component that owns the sequence. References resolve
from SeqMod itself: a bare name such as
geo1is a sibling of SeqMod,..(the default) is the network SeqMod sits in, and something inside SeqMod needs./name. - Set Seq Name to the part of the parameter names before the block index:
ItemsforItems0name,Items1nameand so on. Empty publishes nothing. - Read the result. ParNames lists every block parameter as a pattern,
Items*name Items*level, and is republished whenever blocks are added or removed.out1carries the same as a table: a row per block parameter, such asItems_name, followed by its value in each block.
ParNames is written for the Parameters field of a Parameter DAT, which is
how SeqMod builds out1 itself. Reference it from your own Parameter DAT, for
example with the expression op('seqMod1').par.Parnames, and that DAT follows
the sequence as it changes.
From Python, the placed SeqMod also exposes Comp (the target COMP), Seq
(the watched sequence, or None while either parameter is unset) and
SeqParNames, the dependable behind ParNames.
Callbacks
Press Create Callbacks to get an editable callbacks DAT; Callbacks is
pointed at it. Until then SeqMod uses a built-in template that does nothing.
The DAT reference follows the same rule as COMP: a bare name is a sibling
of SeqMod, a DAT inside it needs ./name.
The DAT has two hooks, called once per block:
OnAddBlock(seqBlock): a block was added;seqBlockis the new block. When several arrive at once, it runs for each, lowest index first.OnRemoveBlock(seqBlock_idx): a block was removed; you get the index it had, since the block itself is gone. Several at once run from the highest index down.
def OnAddBlock(seqBlock):
debug(f'block {seqBlock.index} added on {seqBlock.owner.path}')
def OnRemoveBlock(seqBlock_idx):
debug(f'block {seqBlock_idx} removed')
Retargeting the tool to another COMP or sequence does not fire them. Errors raised inside a callback are reported on SeqMod itself.
Get it
This tool unlocks with Patreon. It installs through the same picker as everything else and unlocks with the Patreon Base tier or higher, connected from inside TouchDesigner. Everything else in the toolkit stays free and MIT, and the membership is what keeps that work moving.
Parameters
Custom
| Control | Type / default | What it does |
|---|---|---|
COMPComp |
operator.. | The COMP that owns the sequence, resolved like any OP parameter on SeqMod: a bare name ('geo1') is a sibling in the network SeqMod sits in, '..' is that network itself, and a child of SeqMod needs './name'. |
Seq NameSeqname |
textempty | Name of the parameter sequence on the target COMP: the part before the block index (Items for Items0name, Items1name, ...). Empty publishes nothing. |
ParNamesParnamesread-only |
textempty | Read-only. Every block parameter of the sequence as space-separated patterns (Itemsname Itemslevel), republished whenever blocks are added or removed. |
Callbacks
| Control | Type / default | What it does |
|---|---|---|
CallbacksCallbacks |
operatorempty | DAT holding OnAddBlock(seqBlock) and OnRemoveBlock(seqBlock_idx). A bare name is a sibling of SeqMod; a DAT inside it needs './name'. Defaults to the built-in no-op template; Create Callbacks makes an editable one. |
Create CallbacksCreatecallbacks |
button | Create an editable callbacks DAT from the template and point Callbacks at it. |