press a button in python

   27874   5   1
User Avatar
Member
345 posts
Joined:
Offline
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
User Avatar
Member
1925 posts
Joined: Nov. 2006
Online
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()
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
345 posts
Joined:
Offline
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
User Avatar
Member
624 posts
Joined: Aug. 2008
Offline
nice trick
User Avatar
Member
16 posts
Joined: July 2012
Offline
## nodes serial kicker

selectedNodes = hou.selectedNodes()
for sel in selectedNodes:
node.parm('execute').pressButton()
Claire
http://www.coclea.eu [coclea.eu]
User Avatar
Member
151 posts
Joined: Aug. 2012
Offline
@coclea I believe you meant to have the second line be:

for node in selectedNodes:
  • Quick Links