Sequence Class
An object describing and controlling a set of sequential parameters. Accessed via
- the
sequencemember of parameters OP.seqSequence Collection - the set of sequences of an object.me.curSeqin a parameter expression
mySequence = op('/add1').par.point0weight.sequence # get the sequence object
alsoMySequence = op('/add1').seq.point # another way to get the sequence object
# A sequence block is a SequenceBlock object, which gives access to one set of parameters in the sequence.
print(len(seq)) # number of sequence blocks in the sequence
print(seq[0]) # first sequence block in the sequence
for parBlock in seq:
print([par for par in parBlock]) # print all sequence blocks
seq.numBlocks += 1 # add a new sequence block (same as pressing + in the UI)
# Example 2
# Examine siblings of a constant CHOP sequence
n = op('/project1/constant1')
p = n.par.const2name
p.sequenceBlock.par.name # const2name
p.sequenceBlock.par.value # const2value
See also: Sequential Parameters, SequenceBlock Class, SequenceCollection Class
Members
blockSize → int :
Get or set the sequence blocksize.
blocks → list[SequenceBlock] (Read Only):
The set of all blocks in this sequence. A block is a set of parameters which can be repeated in an operator. See SequenceBlock class.
maxBlocks → int | None (Read Only):
The maximum number of blocks allowed in the sequence, or None if limitless.
name → str :
Get or set the sequence name, which affects all its parameter names.
numBlocks → int :
Get or set the total number of parameter blocks in this sequence.
owner → OP (Read Only):
The OP to which this object belongs.
blockPars → list (Read Only):
An intermediate parameter collection object, from which specific sequence parameters can be found.
Returns a list of one parameter from each block.
n.seq.Info.blockPars.Tx n.seq.Info.blockPars.Tx[3] #Par from 4th block.n.seq.Info.blockPars['Tx'] #returns None if not found.
blockParGroups → list (Read Only):
An intermediate parGroup collection object, from which specific sequence parameter groups can be found.
Returns a list of one parGroup from each block.
n.seq.Info.blockParGroups.T n.seq.Info.blockParGroups.T[3] #ParGroup from 4th block.n.seq.Info.blockParGroups['T'] #returns None if not found.
sequencePar → Par (Read Only):
The main sequence parameter defining this sequence.
Methods
[block index]→ SequenceBlock:
Sequence blocks may be easily accessed using the
[]subscript and assignment operators.
- block index - The index of the desired block.
destroyBlock(block)→ None:
Destroy the block of parameters at the given location.
- block - The index of the existing block to destroy.
insertBlock(block)→ SequenceBlock:
Insert a block of parameters at the given location.
- block - The index of the new block to insert.
Returns the newly created block.
TouchDesigner Build: