Difference between revisions of "Par Class"

From TouchDesigner Documentation
Jump to: navigation, search
(Par Class Auto Create)
(Par Class Auto Create)
Line 8: Line 8:
 
     |class=Par
 
     |class=Par
 
     |name=clampMax
 
     |name=clampMax
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the parameter's numerical clamping behavior. 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.
 
     |text=Get or set the parameter's numerical clamping behavior. 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.
Line 15: Line 15:
 
     |class=Par
 
     |class=Par
 
     |name=clampMin
 
     |name=clampMin
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the parameter's numerical clamping behavior. 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.
 
     |text=Get or set the parameter's numerical clamping behavior. 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.
Line 22: Line 22:
 
     |class=Par
 
     |class=Par
 
     |name=cloneImmune
 
     |name=cloneImmune
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the parameter's clone immunity. When False, the parameter definition is matched to any matching master parameter its operator is cloned to. When True, it is left unchanged.
 
     |text=Get or set the parameter's clone immunity. When False, the parameter definition is matched to any matching master parameter its operator is cloned to. When True, it is left unchanged.
Line 29: Line 29:
 
     |class=Par
 
     |class=Par
 
     |name=default
 
     |name=default
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the parameter's default value. Can only be set on Custom Parameters.  Only one of default, defaultExpr can be set.
 
     |text=Get or set the parameter's default value. Can only be set on Custom Parameters.  Only one of default, defaultExpr can be set.
Line 36: Line 36:
 
     |class=Par
 
     |class=Par
 
     |name=defaultExpr
 
     |name=defaultExpr
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the parameter's default expression. Can only be set on Custom Parameters.  Only one of default, defaultExpr can be set.
 
     |text=Get or set the parameter's default expression. Can only be set on Custom Parameters.  Only one of default, defaultExpr can be set.
Line 45: Line 45:
 
     |class=Par
 
     |class=Par
 
     |name=displayOnly
 
     |name=displayOnly
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the parameter's displayOnly state. Can only be set on Custom Parameters.
 
     |text=Get or set the parameter's displayOnly state. Can only be set on Custom Parameters.
Line 52: Line 52:
 
     |class=Par
 
     |class=Par
 
     |name=enable
 
     |name=enable
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the parameter's enable state. Can only be set on Custom Parameters.
 
     |text=Get or set the parameter's enable state. Can only be set on Custom Parameters.
Line 59: Line 59:
 
     |class=Par
 
     |class=Par
 
     |name=exportOP
 
     |name=exportOP
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=The operator exporting to this parameter.
 
     |text=The operator exporting to this parameter.
Line 66: Line 66:
 
     |class=Par
 
     |class=Par
 
     |name=expr
 
     |name=expr
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the non-evaluated expression only.
 
     |text=Get or set the non-evaluated expression only.
Line 82: Line 82:
 
     |class=Par
 
     |class=Par
 
     |name=isCustom
 
     |name=isCustom
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=True for Custom Parameters.
 
     |text=True for Custom Parameters.
Line 89: Line 89:
 
     |class=Par
 
     |class=Par
 
     |name=isDefault
 
     |name=isDefault
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=True when the parameter value, expression and mode are in their default settings.
 
     |text=True when the parameter value, expression and mode are in their default settings.
Line 96: Line 96:
 
     |class=Par
 
     |class=Par
 
     |name=isFloat
 
     |name=isFloat
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=True for floating point numeric parameters.
 
     |text=True for floating point numeric parameters.
Line 103: Line 103:
 
     |class=Par
 
     |class=Par
 
     |name=isInt
 
     |name=isInt
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=True for integer numeric parameters.
 
     |text=True for integer numeric parameters.
Line 110: Line 110:
 
     |class=Par
 
     |class=Par
 
     |name=isMenu
 
     |name=isMenu
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=True for menu parameters.
 
     |text=True for menu parameters.
Line 117: Line 117:
 
     |class=Par
 
     |class=Par
 
     |name=isMomentary
 
     |name=isMomentary
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=True for momentary parameters.
 
     |text=True for momentary parameters.
Line 124: Line 124:
 
     |class=Par
 
     |class=Par
 
     |name=isNumber
 
     |name=isNumber
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=True for numeric parameters.
 
     |text=True for numeric parameters.
Line 131: Line 131:
 
     |class=Par
 
     |class=Par
 
     |name=isOP
 
     |name=isOP
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=True for OP parameters.
 
     |text=True for OP parameters.
Line 138: Line 138:
 
     |class=Par
 
     |class=Par
 
     |name=isPulse
 
     |name=isPulse
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=True for pulse parameters.
 
     |text=True for pulse parameters.
Line 145: Line 145:
 
     |class=Par
 
     |class=Par
 
     |name=isPython
 
     |name=isPython
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=True for python parameters.
 
     |text=True for python parameters.
Line 152: Line 152:
 
     |class=Par
 
     |class=Par
 
     |name=isString
 
     |name=isString
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=True for string parameters.
 
     |text=True for string parameters.
Line 159: Line 159:
 
     |class=Par
 
     |class=Par
 
     |name=isToggle
 
     |name=isToggle
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=True for toggle parameters.
 
     |text=True for toggle parameters.
Line 166: Line 166:
 
     |class=Par
 
     |class=Par
 
     |name=label
 
     |name=label
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the parameter's label. Example: Translate. Can only be set on Custom Parameters.
 
     |text=Get or set the parameter's label. Example: Translate. Can only be set on Custom Parameters.
Line 173: Line 173:
 
     |class=Par
 
     |class=Par
 
     |name=max
 
     |name=max
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the parameter's numerical maximum value. The parameter's value will be clamped at that maximum if clampMax = True. Can only be set on Custom Parameters.
 
     |text=Get or set the parameter's numerical maximum value. The parameter's value will be clamped at that maximum if clampMax = True. Can only be set on Custom Parameters.
Line 180: Line 180:
 
     |class=Par
 
     |class=Par
 
     |name=menuIndex
 
     |name=menuIndex
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set a menu constant value by its index.
 
     |text=Get or set a menu constant value by its index.
Line 187: Line 187:
 
     |class=Par
 
     |class=Par
 
     |name=menuLabels
 
     |name=menuLabels
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set a list of all possible menu choice labels. In the case of non menu parameters, None is returned. Can only be set on Custom Parameters.
 
     |text=Get or set a list of all possible menu choice labels. In the case of non menu parameters, None is returned. Can only be set on Custom Parameters.
Line 194: Line 194:
 
     |class=Par
 
     |class=Par
 
     |name=menuNames
 
     |name=menuNames
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set a list of all possible menu choice names. In the case of non menu parameters, None is returned. Can only be set on Custom Parameters.
 
     |text=Get or set a list of all possible menu choice names. In the case of non menu parameters, None is returned. Can only be set on Custom Parameters.
Line 201: Line 201:
 
     |class=Par
 
     |class=Par
 
     |name=menuSource
 
     |name=menuSource
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set an expression that returns an object with .menuItems .menuNames members.  This can be used to create a custom menu whose entries dynamically follow that of another menu for example.  Example:  p.menuSource = "op('audiodevin1').par.device".  Note the outside quotes, as menuSource is an expression, not an object.
 
     |text=Get or set an expression that returns an object with .menuItems .menuNames members.  This can be used to create a custom menu whose entries dynamically follow that of another menu for example.  Example:  p.menuSource = "op('audiodevin1').par.device".  Note the outside quotes, as menuSource is an expression, not an object.
Line 208: Line 208:
 
     |class=Par
 
     |class=Par
 
     |name=min
 
     |name=min
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the parameter's numerical minimum value. The parameter's value will be clamped at that minimum if clampMin = True. Can only be set on Custom Parameters.
 
     |text=Get or set the parameter's numerical minimum value. The parameter's value will be clamped at that minimum if clampMin = True. Can only be set on Custom Parameters.
Line 215: Line 215:
 
     |class=Par
 
     |class=Par
 
     |name=mode
 
     |name=mode
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the parameter's evaluation mode.
 
     |text=Get or set the parameter's evaluation mode.
Line 228: Line 228:
 
     |class=Par
 
     |class=Par
 
     |name=name
 
     |name=name
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the parameter's unique name. Example: Translate. Can only be set on Custom Parameters.
 
     |text=Get or set the parameter's unique name. Example: Translate. Can only be set on Custom Parameters.
Line 235: Line 235:
 
     |class=Par
 
     |class=Par
 
     |name=normMax
 
     |name=normMax
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the parameter's maximum slider value if the parameter is a numerical slider. Can only be set on Custom Parameters.
 
     |text=Get or set the parameter's maximum slider value if the parameter is a numerical slider. Can only be set on Custom Parameters.
Line 242: Line 242:
 
     |class=Par
 
     |class=Par
 
     |name=normMin
 
     |name=normMin
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the parameter's minimum slider value if the parameter is a numerical slider. Can only be set on Custom Parameters.
 
     |text=Get or set the parameter's minimum slider value if the parameter is a numerical slider. Can only be set on Custom Parameters.
Line 249: Line 249:
 
     |class=Par
 
     |class=Par
 
     |name=normVal
 
     |name=normVal
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the parameter's value as a normalized slider position. Can only be set on Custom Parameters.
 
     |text=Get or set the parameter's value as a normalized slider position. Can only be set on Custom Parameters.
Line 256: Line 256:
 
     |class=Par
 
     |class=Par
 
     |name=order
 
     |name=order
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=The custom parameter's position on the parameter page.  Can only be set on Custom Parameters.
 
     |text=The custom parameter's position on the parameter page.  Can only be set on Custom Parameters.
Line 263: Line 263:
 
     |class=Par
 
     |class=Par
 
     |name=owner
 
     |name=owner
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=The OP to which this object belongs.
 
     |text=The OP to which this object belongs.
Line 270: Line 270:
 
     |class=Par
 
     |class=Par
 
     |name=page
 
     |name=page
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=The custom parameter page the parameter is part of.  Can only be set on Custom Parameters.
 
     |text=The custom parameter page the parameter is part of.  Can only be set on Custom Parameters.
Line 277: Line 277:
 
     |class=Par
 
     |class=Par
 
     |name=prevMode
 
     |name=prevMode
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=The parameter's previous evaluation mode.
 
     |text=The parameter's previous evaluation mode.
Line 284: Line 284:
 
     |class=Par
 
     |class=Par
 
     |name=startSection
 
     |name=startSection
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=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.
 
     |text=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.
Line 291: Line 291:
 
     |class=Par
 
     |class=Par
 
     |name=style
 
     |name=style
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Describes the behaviour and contents of the custom parameter. Example 'Float', 'Int', 'Pulse', 'XYZ', etc.
 
     |text=Describes the behaviour and contents of the custom parameter. Example 'Float', 'Int', 'Pulse', 'XYZ', etc.
Line 298: Line 298:
 
     |class=Par
 
     |class=Par
 
     |name=tuplet
 
     |name=tuplet
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=The tuplet of parameters this parameter belongs to. A tuplet is typically a set of parameters sharing one line on a parameter dialog, example:  Translate (x, y, z).
 
     |text=The tuplet of parameters this parameter belongs to. A tuplet is typically a set of parameters sharing one line on a parameter dialog, example:  Translate (x, y, z).
Line 305: Line 305:
 
     |class=Par
 
     |class=Par
 
     |name=tupletName
 
     |name=tupletName
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=The tuplet name of a parameter.  Example: The tuplet name of a (tx,ty,tz) translate parameter is t.
 
     |text=The tuplet name of a parameter.  Example: The tuplet name of a (tx,ty,tz) translate parameter is t.
Line 312: Line 312:
 
     |class=Par
 
     |class=Par
 
     |name=val
 
     |name=val
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the constant value of the parameter only.
 
     |text=Get or set the constant value of the parameter only.
Line 327: Line 327:
 
     |class=Par
 
     |class=Par
 
     |name=valid
 
     |name=valid
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=True if the referenced parameter currently exists, False if it has been deleted.
 
     |text=True if the referenced parameter currently exists, False if it has been deleted.
Line 334: Line 334:
 
     |class=Par
 
     |class=Par
 
     |name=index
 
     |name=index
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=The parameter's order in the list.
 
     |text=The parameter's order in the list.
Line 341: Line 341:
 
     |class=Par
 
     |class=Par
 
     |name=vecIndex
 
     |name=vecIndex
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=The parameter's vector index. For example, op('geo1').par.tz would have a value of 2.
 
     |text=The parameter's vector index. For example, op('geo1').par.tz would have a value of 2.
Line 351: Line 351:
 
{{ClassMethod
 
{{ClassMethod
 
     |class=Par
 
     |class=Par
     |name=evalOPs
+
     |name=evalExport
     |call=evalOPs()
+
     |call=evalExport()
 +
    |returns=
 +
    |text=: -> value
 +
Evaluate the export portion of a parameter, if it contains one.  This will ignore any expressions, etc.
 +
a = op('geo1').par.tx.evalExport()
 +
}}
 +
{{ClassMethod
 +
    |class=Par
 +
    |name=evalExpression
 +
    |call=evalExpression()
 
     |returns=
 
     |returns=
     |text=: -> list
+
     |text=: -> value
Evaluate the parameter as series of operators.  This is useful for a custom  parameter that specifies a list of operator paths for example.
+
Evaluate the expression portion of a parameter, if it contains one.  This will ignore any exports, etc.
a = op('base1').par.Paths.evalOPs()
+
a = op('geo1').par.tx.evalExpression()
 +
To evaluate an arbitrary expression string, that is not inside a parameter, see OP.evalExpression.
 
}}
 
}}
 
{{ClassMethod
 
{{ClassMethod
Line 365: Line 375:
 
     |text=: -> value
 
     |text=: -> value
 
Similar to eval() but the returns the normalized slider value.
 
Similar to eval() but the returns the normalized slider value.
 +
}}
 +
{{ClassMethod
 +
    |class=Par
 +
    |name=evalOPs
 +
    |call=evalOPs()
 +
    |returns=
 +
    |text=: -> list
 +
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').par.Paths.evalOPs()
 
}}
 
}}
 
{{ClassMethod
 
{{ClassMethod
Line 377: Line 396:
 
{{ClassMethod
 
{{ClassMethod
 
     |class=Par
 
     |class=Par
     |name=destroy
+
     |name=copy
     |call=destroy()
+
     |call=copy(Par)
 
     |returns=
 
     |returns=
 
     |text=:
 
     |text=:
Destroy the custom parameter referenced by this ParAn exception will be raised if the parameter has already been destroyed.
+
Copy the specified parameter.
}}
+
  Par - The parameter to copy.
{{ClassMethod
+
op('geo1').par.tx.copy( op('geo2').par.tx )
    |class=Par
 
    |name=evalExport
 
    |call=evalExport()
 
    |returns=
 
    |text=: -> value
 
Evaluate the export portion of a parameter, if it contains one.  This will ignore any expressions, etc.
 
a = op('geo1').par.tx.evalExport()
 
 
}}
 
}}
 
{{ClassMethod
 
{{ClassMethod
Line 411: Line 423:
 
{{ClassMethod
 
{{ClassMethod
 
     |class=Par
 
     |class=Par
     |name=evalExpression
+
     |name=destroy
     |call=evalExpression()
+
     |call=destroy()
    |returns=
 
    |text=: -> value
 
Evaluate the expression portion of a parameter, if it contains one.  This will ignore any exports, etc.
 
a = op('geo1').par.tx.evalExpression()
 
To evaluate an arbitrary expression string, that is not inside a parameter, see OP.evalExpression.
 
}}
 
{{ClassMethod
 
    |class=Par
 
    |name=copy
 
    |call=copy(Par)
 
 
     |returns=
 
     |returns=
 
     |text=:
 
     |text=:
Copy the specified parameter.
+
Destroy the custom parameter referenced by this ParAn exception will be raised if the parameter has already been destroyed.
  Par - The parameter to copy.
 
op('geo1').par.tx.copy( op('geo2').par.tx )
 
 
}}}}
 
}}}}
 
<section end=HELPBODY />
 
<section end=HELPBODY />
 
{{History}}
 
{{History}}
 
{{#invoke:Category|list|Python Reference}}
 
{{#invoke:Category|list|Python Reference}}

Revision as of 15:11, 15 September 2017

The Par class describes an instance of a single Parameter. See also Custom Parameters.


Members[edit]

clampMax(Read Only):

Get or set the parameter's numerical clamping behavior. 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.

clampMin(Read Only):

Get or set the parameter's numerical clamping behavior. 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.

cloneImmune(Read Only):

Get or set the parameter's clone immunity. When False, the parameter definition is matched to any matching master parameter its operator is cloned to. When True, it is left unchanged.

default(Read Only):

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

defaultExpr(Read Only):

Get or set the parameter's default expression. Can only be set on Custom Parameters. Only one of default, defaultExpr can be set. op('base1').par.Size.defaultExpr = 'me.time.frame' #value defaults to this expression.

displayOnly(Read Only):

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

enable(Read Only):

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

exportOP(Read Only):

The operator exporting to this parameter.

expr(Read Only):

Get or set the non-evaluated expression only.

op('geo1').par.tx.expr = 'me.time.frame' #set to match current frame

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


To get the parameter's current value, regardless if it's from a constant, expression, or export, use the eval() method described 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.

isCustom(Read Only):

True for Custom Parameters.

isDefault(Read Only):

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

isFloat(Read Only):

True for floating point numeric parameters.

isInt(Read Only):

True for integer numeric parameters.

isMenu(Read Only):

True for menu parameters.

isMomentary(Read Only):

True for momentary parameters.

isNumber(Read Only):

True for numeric parameters.

isOP(Read Only):

True for OP parameters.

isPulse(Read Only):

True for pulse parameters.

isPython(Read Only):

True for python parameters.

isString(Read Only):

True for string parameters.

isToggle(Read Only):

True for toggle parameters.

label(Read Only):

Get or set the parameter's label. Example: Translate. Can only be set on Custom Parameters.

max(Read Only):

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

menuIndex(Read Only):

Get or set a menu constant value by its index.

menuLabels(Read Only):

Get or set a list of all possible menu choice labels. In the case of non menu parameters, None is returned. Can only be set on Custom Parameters.

menuNames(Read Only):

Get or set a list of all possible menu choice names. In the case of non menu parameters, None is returned. Can only be set on Custom Parameters.

menuSource(Read Only):

Get or set an expression that returns an object with .menuItems .menuNames members. This can be used to create a custom menu whose entries dynamically follow that of another menu for example. Example: p.menuSource = "op('audiodevin1').par.device". Note the outside quotes, as menuSource is an expression, not an object.

min(Read Only):

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

mode(Read Only):

Get or set the parameter's evaluation mode.

op('geo1').par.tx.mode = ParMode.EXPRESSION

The mode is one of: ParMode.CONSTANT, ParMode.EXPRESSION, or ParMode.EXPORT.

See Parameter_Dialog#Working_with_Parameter_Modes for more information.

name(Read Only):

Get or set the parameter's unique name. Example: Translate. Can only be set on Custom Parameters.

normMax(Read Only):

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

normMin(Read Only):

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

normVal(Read Only):

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

order(Read Only):

The custom parameter's position on the parameter page. Can only be set on Custom Parameters.

owner(Read Only):

The OP to which this object belongs.

page(Read Only):

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

prevMode(Read Only):

The parameter's previous evaluation mode.

startSection(Read Only):

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.

style(Read Only):

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

tuplet(Read Only):

The tuplet of parameters this parameter belongs to. A tuplet is typically a set of parameters sharing one line on a parameter dialog, example: Translate (x, y, z).

tupletName(Read Only):

The tuplet name of a parameter. Example: The tuplet name of a (tx,ty,tz) translate parameter is t.

val(Read Only):

Get or set the constant value of the parameter only.

op('geo1').par.tx.val = 5 op('geo1').par.tx = 5 #equivalent to above, more concise form

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


To get the parameter's current value, regardless if it's from a constant, expression, or export, use the eval() method described below. To set a menu value by its index, use the menuIndex member as described below.

valid(Read Only):

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

index(Read Only):

The parameter's order in the list.

vecIndex(Read Only):

The parameter's vector index. For example, op('geo1').par.tz would have a value of 2.

Methods[edit]

evalExport():

: -> value

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

a = op('geo1').par.tx.evalExport()

evalExpression():

: -> value

Evaluate the expression portion of a parameter, if it contains one. This will ignore any exports, etc. a = op('geo1').par.tx.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 value.

evalOPs():

: -> list

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').par.Paths.evalOPs()

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').par.tx.eval()

copy(Par):

:

Copy the specified parameter. Par - The parameter to copy.

op('geo1').par.tx.copy( op('geo2').par.tx )

pulse(value, frames=nframes, seconds=nseconds):

:

Pulsing sets a parameter to the specific value, cooks the operator, then restores the parameter to its previous value. No value is necessary when the parameter is an actual pulse type. value - (Optional) The value to pulse this parameter with, default is 1. frames - (Optional) Number of frames before restoring the parameter to its original value. seconds - (Optional) Number of seconds before restoring the parameter to its original value. op('moviein1').par.reload.pulse(1) #set the reload toggle, then cook op('glsl1').par.loadvariablenames.pulse() #activate the pulse parameter op('geo1').par.ty.pulse(2, frames=120) #pulse geometry ty for 120 frames op('text1').par.text.pulse('GO!', seconds=3)#pulse text TOP string field, for 3 seconds

op('noise').par.type.pulse('random', seconds=0.5)#pulse noise meny type for half a second

destroy():

: Destroy the custom parameter referenced by this Par. An exception will be raised if the parameter has already been destroyed.

TouchDesigner Build:

Parameters in TouchDesigner are an operator's settings (numbers, menus, flags, strings, paths) which the user can alter. Parameters for any operator can be opened by right-clicking on the operator and selecting "Parameters..." A currently selected operator's parameters can be viewed in a Network Editor by pressing the keyboard shortcut 'p'.

Any floating window that is not a Pane or Viewer.

To pulse a parameter is to send it a signal from a CHOP or python or a mouse click that causes a new action to occur immediately. A pulse via python is via the .pulse() function on a pulse-type parameter, such as Reset in a Speed CHOP. A pulse from a CHOP is typically a 0 to 1 to 0 signal in a channel.

Any of the procedural data operators. OPs do all the work in TouchDesigner. They "cook" and output data to other OPs, which ultimately result in new images, data and audio being generated. See Node.

An Operator Family that creates, composites and modifies images, and reads/writes images and movies to/from files and the network. TOPs run on the graphics card's GPU.