Home Reference Houdini Object Model hou hou.Parm 

hou.Parm.setExpression method

Sets the parameter’s expression

setExpression(self, expression, language=None)

The language parameter must either be None or a hou.exprLanguage enumeration value.

If language is None and the parameter does not already contain an expression, the language will be the node’s expression language. (See hou.Node.expressionLanguage.) Otherwise, if language is None and the parameter already has an expression, the expression language will not change.

Unlike hou.Parm.set, this method does not follow channel references. That is, if this parameter is referencing another parameter and you call setExpression(), it change the channel reference expression into the specified expression.

This method is roughly equivalent to setting a keyframe at the current time, where the keyframe’s expression and language are the ones specified. This method does not delete any previous keyframes.

For non-string parameters, this method is rougly equivalent to:

k = hou.Keyframe()
k.setExpression(expression, language)
parm.setKeyframe(k)

For string parameters, this method is rougly equivalent to:

k = hou.StringKeyframe()
k.setExpression(expression, language)
parm.setKeyframe(k)

See also: hou.Parm.expression, hou.Parm.expressionLanguage, hou.Parm.setKeyframe, hou.Node.expressionLanguage

Replaces: opparm, chkey