Close

ParGroup Class

The ParGroup class describes an instance of a single Parameter.

See also Custom Parameters.


Members

bindExprtuple :

Get or set expressions that return a Parameter object. This can be used to bind this parameter's constant values to the referenced parameters.

Example:

p.bindExpr = ("op('geo1').par.tx", "op('geo1').par.ty", "op('geo1').par.tz")

Note the outside quotes, as bindExpr is an expression, not an object.

bindMastertuple (Read Only):

The objects to which this parameter is bound to, possibly None.

bindRangebool :

Get or set parameter's range binding state. If True, min, max, clampMin, clampMax, normMin, normMax, normVal values will be based on master bind parameter. Can only be set on Custom Parameters.

bindReferencestuple (Read Only):

The (possibly empty) lists of objects which bind to this parameter.

clampMaxtuple :

Get or set the parameter's numerical clamping behaviors. If set to clampMax = True, the parameter will clamp on the upper end at the value specified in max Can only be set on Custom Parameters.

clampMintuple :

Get or set the parameter's numerical clamping behaviors. If set to clampMin = True, the parameter will clamp on the lower end at the value specified in min Can only be set on Custom Parameters.

collapsablebool (Read Only):

Returns True if the parameter is collapsable.

collapserbool (Read Only):

Returns True if the parameter is a parent of collapsable parameters (ie. a collapser).

defaulttuple :

Get or set the parameter's default values. Can only be set on Custom Parameters. Only one of default, defaultExpr can be set.

defaultExprtuple :

Get or set the parameter's default expressions. Can only be set on Custom Parameters. Only one of default, defaultExpr can be set.

# value defaults to this expression.
op('base1').parGroup.Size.defaultExpr = ('me.time.frame', 'me.time.frame', 'me.time.frame')

defaultBindExprstr :

Get or set the parameter's default bind expressions. Can only be set on Custom Parameters.

# value defaults to this expression.
op('base1').parGroup.Size.defaultBindExpr = ('me.par.tx', 'me.par.ty', 'me.par.tz')

defaultModeParMode :

Get or set the parameter's evaluation modes.

op('geo1').parGroup.t.defaultMode = (ParMode.EXPRESSION, ParMode.EXPRESSION, ParMode.EXPRESSION)

The modes are one of: ParMode.CONSTANT, ParMode.EXPRESSION, or ParMode.EXPORT, or ParMode.BIND.

See Parameter_Dialog#Working_with_Parameter_Modes for more information.

enablebool :

Get or set the parameter's enable state. Can only be set on Custom Parameters.

enableExprstring :

Get or set an expression that controls the enable state for this parameter group.

p.enableExpr = "me.par.X.menuIndex == 5"

Note the outside quotes, as this is an expression, not an object.

exportOPtuple (Read Only):

The operators exporting to this parameter.

exportSourcetuple of cell, channel or None (Read Only):

The objects exporting to this parameter. Examples: Cell, Channel or None.

exprtuple :

Get or set the non-evaluated expressions only. To get the parameter's current values, regardless of the Parameter Mode (constant, expression, export or bound), use the eval() method described below.

op('geo1').parGroup.t.expr = ('absTime.frame', 'absTime.frame', 'absTime.frame')  
# set to match current frame

When setting this member, the parameter will also be placed in expression mode. See mode member below.

NOTE: For convenience, the expression is placed in double-quotes so you can safely put in expressions containing single quotes. 'a' and "a" have the same effect of enclosing strings in python.

helpstring :

Get or set a custom parameter's help text. To see any parameter's help, rollover the parameter while holding the Alt key.

isDefaultbool (Read Only):

True when the parameter value, expression and mode are in their default settings.

isCustombool (Read Only):

True for Custom Parameters.

isFloatbool (Read Only):

True for floating point numeric parameters.

isIntbool (Read Only):

True for integer numeric parameters.

isMenubool (Read Only):

True for menu parameters.

isMomentarybool (Read Only):

True for momentary parameters.

isNumberbool (Read Only):

True for numeric parameters.

isOPbool (Read Only):

True for OP parameters.

isPulsebool (Read Only):

True for pulse parameters.

isPythonbool (Read Only):

True for python parameters.

isSequencebool (Read Only):

True for sequence header parameters.

isStringbool (Read Only):

True for string parameters.

isTogglebool (Read Only):

True for toggle parameters.

labelstring :

Get or set the parameter's label.

op('myOperator').parGroup.Custompar.label = 'Translate'

Can only be set on Custom Parameters.

maxtuple :

Get or set the parameter's numerical maximum values. The parameter's values will be clamped at that maximum if clampMax = True. Can only be set on Custom Parameters.

menuIndextuple :

Get or set a tuple of menu constant values by their indices.

menuLabelstuple :

Get or set a tuple of lists of all possible menu choice labels. In the case of non menu parameters, None(s) are returned. Can only be set on Custom Parameters.

menuNamestuple :

Get or set a tuple of lists of all possible menu choice names. In the case of non menu parameters, None(s) are returned. Can only be set on Custom Parameters.

menuSourcetuple :

Get or set a tuple of expressions that returns objects with .menuItems .menuNames members. This can be used to create a custom menu whose entries dynamically follow that of another menu for example.

mintuple :

Get or set the parameter's numerical minimum values. The parameter's values will be clamped at that minimum if clampMin = True for the particular Par. Can only be set on Custom Parameters.

modetuple :

Get or set the parameter's evaluation modes.

op('geo1').parGroup.t.mode = (ParMode.EXPRESSION, ParMode.EXPRESSION, ParMode.EXPRESSION)

The modes are one of: ParMode.CONSTANT, ParMode.EXPRESSION, or ParMode.EXPORT, or ParMode.BIND.

See Parameter_Dialog#Working_with_Parameter_Modes for more information.

namestring :

Get or set the parameter's unique name.

op('myOperator').parGroup.Custompar.name = 'Translate'

Can only be set on Custom Parameters.

baseNamestring :

Get or set the parameter's base name. This excludes any sequence prefixes, sequence indices or name suffixes. Can only be set on Custom Parameters.

normMaxtuple :

Get or set the parameter's maximum slider values if the parameter is a numerical slider. Can only be set on Custom Parameters.

normMintuple :

Get or set the parameter's minimum slider values if the parameter is a numerical slider. Can only be set on Custom Parameters.

normValtuple :

Get or set the parameter's values as a normalized slider position. Can only be set on Custom Parameters.

orderint :

Get or set the parameter's position on the parameter page. Can only be set on Custom Parameters.

ownerOP (Read Only):

The OP to which this object belongs.

pagePage :

Get or set the parameter page the custom parameter is part of. Can only be set on Custom Parameters.

passwordbool :

Get or set the parameter's password mode. When True all text is rendered as asterisks. Can only be set on Custom string, int or float parameters. Custom Parameters.

prevModetuple (Read Only):

The parameter's previous evaluation modes.

readOnlybool :

Get or set the parameter's read only status. When True the parameter cannot be modified through the UI, only scripting.

displayOnlybool :

Get or set the parameter's displayOnly state. Can only be set on Custom Parameters.

startSectionbool :

Get or set the parameter's separator status. When True a visible separator is drawn between this parameter and the ones preceding it. Can only be set on Custom Parameters.

stylestring (Read Only):

Describes the behavior and contents of the custom parameter. Example 'Float', 'Int', 'Pulse', 'XYZ', etc.

subLabeltuple (Read Only):

Returns the names of the sub-label.

valtuple :

Get or set the constant values of the parameter only. To get the parameter's current values, regardless of the Parameter Modes (constant, expression, export or bound), use the eval() method described below.

op('geo1').parGroup.t.val   # the constant values 
op('geo1').parGroup.t.eval()   # the evaluated parameter
op('geo1').parGroup.t.val = (1,2,3)
op('geo1').parGroup.t = (1,2,3)  #equivalent to above, more concise form

When setting this member, the parameter will also be placed in constant mode. See mode member below.

To set a menu value by its index, use the menuIndex member as described below.

validbool (Read Only):

True if the referenced parameter currently exists, False if it has been deleted.

indexint (Read Only):

The parameter's order in the list.

sequenceSequence (Read Only):

The Sequence this parGroup is a part of. None if not in a sequence.

blockIndexint (Read Only):

The index of the parGroup within its SequenceBlock. None if not in a sequence.

sequenceIndexint (Read Only):

The index of the parGroup's SequenceBlock in its Sequence. None if not in a sequence.

sizeint :

Get or set the parameter's vector size.

Methods

copy(ParGroup)None:

Copy the specified parameter.

  • ParGroup - The parameter to copy.
op('geo1').parGroup.t.copy( op('geo2').parGroup.t )

destroy()None:

Destroy the parameter referenced by this ParGroup. An exception will be raised if the parameter has already been destroyed. Only custom and sequential parameters can be destroyed. Destroying a sequential parameter will destroy its entire block. Note: When any parameter is destroyed, any existing parameter objects will be invalid and should be re-fetched.

eval()tuple:

Evaluate a parameter group. This value may be derived by the parameter group's constant value, expression, or export, dependent on its mode.

a = op('geo1').parGroup.t.eval()

evalExport()tuple:

Evaluate the export portions of a parameter, if it contains any. This will ignore any expressions, etc.

a = op('geo1').parGroup.t.evalExport()

evalExpression()tuple:

Evaluate the expression portions of a parameter, if it contains any. This will ignore any exports, etc.

a = op('geo1').parGroup.t.evalExpression()

To evaluate an arbitrary expression string, that is not inside a parameter, see OP.evalExpression.

evalNorm()tuple:

Similar to eval() but the returns the normalized slider values.

evalOPs()tuple of lists:

Evaluate the parameter as series of operators. This is useful for a custom parameter that specifies a list of operator paths for example.

a = op('base1').parGroup.Paths.evalOPs()

pars(pattern)list:

Returns a (possibly empty) list of parameter objects that match the pattern.

  • pattern - Is a string following the Pattern Matching rules, specifying which parameters to return.
# translate parameters
newlist = op('geo1').parGroup.t.pars('t?')

reset()bool:

Resets the parameter group to its default state.

Returns true if anything was changed.

op('geo1').parGroup.t.reset()

TouchDesigner Build: