Close

Experimental:ParGroup Class

The ParGroup class describes an instance of a single Parameter.

See also Custom Parameters.


Members

bindExprstring :

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:

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

bindMaster(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.

bindReferenceslist (Read Only):

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

clampMaxbool :

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.

clampMinbool :

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).

defaultvalue :

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

defaultExprstring :

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')

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.

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

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

exportOPOP (Read Only):

The operators exporting to this parameter.

exportSourcecell, channel or None (Read Only):

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

exprstring :

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.

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.

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.

maxint or float :

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.

menuIndexint :

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

menuLabelsstring :

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.

menuNamesstring :

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.

minint or float :

Get or set the parameter's numerical minimum values. The parameter's values will be clamped at that minimum if clampMin = True. 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.

normMaxint or float :

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

normMinint or float :

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

normValfloat :

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.

prevMode(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.

sequence(Read Only):

The set of sequential parameter blocks this parameter belongs to, or None.

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.

subLabelstring (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.

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()value:

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

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

evalExport()value:

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

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

evalExpression()value:

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()value:

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?')