Last active
August 3, 2021 02:23
-
-
Save morphingdesign/e96badfb97505837b6a97fb351e9036a to your computer and use it in GitHub Desktop.
Method for setting parameter values with specified data type or expressions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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