Search - User list
Full Version: press a button in python
Root » Technical Discussion » press a button in python
kuba
Hi everyone,
A quick python related question. What is the equivalent of opparm -c in python? I am getting an error while using hou.Parm.pressButton method. Not sure how do I specify a path to the parameter in this method. Any help is really appreciated.

thanks
kuba
graham
A hou.Parm object takes a path to a parameter on a node.

On something like a file sop, you can do:

hou.parm('/obj/geo1/file1/reload').pressButton()

or

hou.node('/obj/geo1/file1').parm('reload').pressButton()
kuba
Thanks will find in a second,

btw, I found not so elegant solution for that:

hou.hscript('opparm -c /out/mantra testA execute')


Cheers
kuba
pelos
nice trick
coclea
## nodes serial kicker

selectedNodes = hou.selectedNodes()
for sel in selectedNodes:
node.parm('execute').pressButton()
Fenolis
@coclea I believe you meant to have the second line be:

for node in selectedNodes:
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB