Simple parameter editing Python error.
1611
3
0
Hi,
I'm trying to modify parameters of a node using python, based off the example on this page:
http://www.sidefx.com/docs/houdini/hom/tool_script [
www.sidefx.com]
This is my code:
sphere = hou.node(“/obj/sphere1”)
current_tx = sphere.parm(“tx”).get()
print current_tx
sphere.parm(“tx”).set(5)
And this is the error I get:
Traceback (most recent call last):
File “tool_1”, line 3, in <module>
AttributeError: ‘Parm’ object has no attribute ‘get’
I've tried in both the python shell and as a shelf tool and it's driving me mad.
What am I doing wrong?
Edited by councilofevil - Sept. 26, 2017 13:55:04
-
- rdms
- Member
- 201 posts
- Joined: July 2005
- Offline
I'm assuming you want to print out the current value of the parameter so try this:
current_tx = sphere.evalParm(“tx”)
Cheers,
Rob
Digital Supervisor | Stargate Studios Toronto
rdms
I'm assuming you want to print out the current value of the parameter so try this:
current_tx = sphere.evalParm(“tx”)
Thank you, this works! Out of interest, do you know why the original .get() didn't?