hou.ParmTuple class

The parmTuple() function returns a parameter tuple by its path. The ParmTuple class represents a parameter tuple on a node.

All Methods Replaces

A parameter tuple often corresponds to a two or three parameters on the same line in the parameter dialog. For example, the “t” parameter tuple contains the “tx”, “ty”, and “tz” parameters.

When a parameter is evaluating, hou.pwd returns the node containing that parameter, so hou.parmTuple() can be used inside expressions to perform relative parameter references.

Methods

asCode(self, brief=False, function_name=None)str

Returns the Python code necessary to recreate this parm tuple.

brief

Do not set values if they are the parameter’s default.

function_name

If specified, the output will be wrapped in a this function.

deleteAllKeyframes(self)

Removes all the keyframes from this parameter tuple.

This method is equivalent to…

for parm in self:
    parm.deleteAllKeyframes()

See also hou.Parm.deleteAllKeyframes.

description(self)str

Returns this parameter tuple’s label.

eval(self) → tuple of int, float, str, or hou.Ramp

Evalutes this parameter tuple at the current frame and returns the result as a tuple of integers, floats or strings, or a hou.Ramp object, depending on the type of the parameter.

See also the evalAtFrame() method.

evalAsFloats(self) → tuple of float

Evaluates this parameter tuple at the current frame and returns the result as a tuple of floats.

Raises hou.TypeError if a value cannot be converted to a float.

evalAsFloatsAtFrame(self, frame) → tuple of float

Evaluates this parameter tuple at a certain frame and returns the result as a tuple of floats.

Raises hou.TypeError if a value cannot be converted to a float.

evalAsInts(self) → tuple of int

Evaluates this parameter tuple at the current frame and returns the result as a tuple of integers.

Raises hou.TypeError if a value cannot be converted to an integer.

evalAsIntsAtFrame(self, frame) → tuple of int

Evaluates this parameter tuple at a certain frame and returns the result as a tuple of integers.

Raises hou.TypeError if a value cannot be converted to an integer.

evalAsRamp(self)hou.Ramp

Evaluates this parameter tuple at the current frame and returns the result as a hou.Ramp object.

Raises hou.TypeError if this is not a ramp parameter.

evalAsRampAtFrame(self, frame)hou.Ramp

Evaluates this parameter tuple at a certain frame and returns the result as a Ramp object.

Raises hou.TypeError if this is not a ramp parameter.

evalAsStrings(self) → tuple of str

Evaluates this parameter tuple at the current frame and returns the result as a tuple of strings.

Raises hou.TypeError if a value cannot be converted to a string.

evalAsStringsAtFrame(self, frame) → tuple of str

Evaluates the parameter tuple at a frame and returns the result as a tuple of strings.

Raises hou.TypeError if a value cannot be converted to a string.

evalAtFrame(self, frame) → tuple of int, float, str, or hou.Ramp

Evalutes the parameter tuple at a certain frame and returns the result as a tuple of integers, floats, strings, or a Ramp object, depending on the type of the parameter.

isSpare(self)bool

Returns whether the parameter is a “spare” (user-defined) parameter.

lock(self, bool_values)

bool_values

A sequence of True or False values, where each value corresponds to a component of this parameter. Where an element of bool_values is True, that component will be locked (uneditable), and where an element is False, the corresponding component will be unlocked (editable).

For example, the parameter tuple for “translation” contains Parm objects for translation along each of the axes, “tx”, “ty” and “tz”. If lock is called with the following tuple of boolean values, (True, True, False), then the parameter “tx” and “ty” will be locked and made non-editable, while “tz” will be unlocked and made editable.

Raises hou.InvalidSize if bool_values has a different length than this parameter tuple. Raises hou.PermissionError if any of the parameters in this parameter tuple are not writable.

name(self)str

Returns the name of this parameter tuple.

node(self)hou.Node

Returns the node on which this parameter tuple exists.

parmTemplate(self)hou.ParmTemplate

Returns this parameter tuple’s template.

revertToAndRestorePermanentDefaults(self)

Changes the value back to the defaults that ship with Houdini, and restore those defaults.

See also the revertToDefaults() method.

revertToDefaults(self)

Changes the value back to the default(s). See also the revertToAndRestoreFactoryDefaults() method.

set(self, values)

Sets the value of a parameter in the tuple at the current frame.

values

A sequence of floats or strings, corresponding to the components of this parameter tuple.

For example, the parameter tuple for “translation” contains Parm objects for translation along each of the axes, “tx”, “ty” and “tz”. If set is called with following tuple of floats, (2.5, 4.0, 5.5), then the parameter “tx” with be set to 2.5, “ty” will be set to 4.0 and “tz” will be set to 5.5.

Raises hou.InvalidSize if values has a different length than this parameter tuple. Raises hou.PermissionError if any of the parameters in this parameter tuple are not writable.

setAutoscope(self, bool_values)

Changes the autoscope property of components of this parameter tuple.

bool_values

A sequence of True or False values, where each value corresponds to a component of this parameter. Where an element of bool_values is True, that component will be autoscope.

For example, the parameter tuple for “translation” contains Parm objects for translation along each of the axes, “tx”, “ty” and “tz”. If setAutoscope is called with the following tuple of boolean values, (True, True, False), then the parameter “tx” and “ty” will be automatically scoped, while “tz” will not.

Raises hou.InvalidSize if values has a different length than this parameter tuple. Raises hou.PermissionError if any of the parameters in this parameter tuple are not writable.

setExpression(self, expression_tuple, language=hou.exprLanguage.Python)

Not implemented yet

setPending(self, values)

Sets the value of a parameter in the tuple at the current frame and marks it as pending if the parameter is keyed.

values

A sequence of floats or strings, corresponding to the components of this parameter tuple.

For example, the parameter tuple for “translation” contains Parm objects for translation along each of the axes, “tx”, “ty” and “tz”. If set is called with following tuple of floats, (2.5, 4.0, 5.5), then the parameter “tx” with be set to 2.5, “ty” will be set to 4.0 and “tz” will be set to 5.5.

Raises hou.InvalidSize if values has a different length than this parameter tuple. Raises hou.PermissionError if any of the parameters in this parameter tuple are not writable.

__getitem__(self, index)hou.Parm

Returns the Parm object for the specified component of this parameter tuple. The valid range for index is 0 to len(self) - 1.

For example, the parameter tuple for “translation” contains Parm objects for translation along each of the axes, “tx”, “ty” and “tz”. translation[0] would return the Parm object for “tx”, translation[1] would return the Parm object for “ty”, and so on.

Raises IndexError if the index is not within the valid range.

__len__(self)int

Returns the length of (number of parameter components in) this parameter tuple.

Replaces

chautoscope command , chlock command , opparm command , opscript command , chramp expression function