Skip to content

Instantly share code, notes, and snippets.

@morphingdesign
Last active August 3, 2021 02:23
Show Gist options
  • Save morphingdesign/e96badfb97505837b6a97fb351e9036a to your computer and use it in GitHub Desktop.
Save morphingdesign/e96badfb97505837b6a97fb351e9036a to your computer and use it in GitHub Desktop.
Method for setting parameter values with specified data type or expressions.
rotateNode = hou.node('obj/box1/transform1')
speed = 20
# set() used to specify param value with corresponding data type.
rotateNode.parm('rz').set(10)
# However, it cannot be used to set the value with a non-compatible
# data type, such as a string channel reference. The use of
# setExpression() allows for such instances.
rotateNode.parm('ry').setExpression('ch("../box1/divrate2") * {}'.format(speed))
# Reference: https://www.sidefx.com/docs/houdini/hom/hou/Parm.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment