walterbehrnes Posted November 20, 2008 Share Posted November 20, 2008 Hi, I am stumped on this. I have an OTL that I created with a button on it. The buttons parameter name is called "doIt". How would I press this button in python? I saw in Houdini Object Model under hou.Parm the pressButton option but I am not sure how to pass the parameter that I want to press to this command. Any ideas? Quote Link to comment Share on other sites More sharing options...
graham Posted November 20, 2008 Share Posted November 20, 2008 All you need is a hou.Parm object mynode = hou.node(mynodepath) mynode.parm('dolt').pressButton() Or you can do hou.parm('mynodepath/dolt').pressButton() 1 Quote Link to comment Share on other sites More sharing options...
walterbehrnes Posted November 20, 2008 Author Share Posted November 20, 2008 Ah! that makes sense. I was reversing where I was putting the call to doIt... Thanks! Walt All you need is a hou.Parm objectmynode = hou.node(mynodepath) mynode.parm('dolt').pressButton() Or you can do hou.parm('mynodepath/dolt').pressButton() Quote Link to comment Share on other sites More sharing options...
walterbehrnes Posted November 20, 2008 Author Share Posted November 20, 2008 Ah... Now I have another issue. I am selecting a group of object nodes, and one by one the script is pressing the same button on each node. Is there a way for me to check the current node to see if it has cooked and the python script attached to doIt has completed its task? I have been searching the Hou module and have only found cook. From the looks of it,this seems to just cook the node. Does it wait for houdini to finish cooking before the script continues? Ah! that makes sense.I was reversing where I was putting the call to doIt... Thanks! Walt Quote Link to comment Share on other sites More sharing options...
walterbehrnes Posted November 20, 2008 Author Share Posted November 20, 2008 Okay, found a way to do this. I created a hidden parm that my buttonPush script sets. the hidden parm gets set to 1, I then push the button (doIt) which runs a secondary script. at the end of the secondary script I set my hidden parm back to 0. After the buttonPush command I enter an while loop that continually checks the state of the hidden parm, when the parm gets set back to zero the script continues this allows for me to cook multiple items and run a secondary script and not have the button push script Execute automatically. heh heh... hope that made sense. Walt Ah... Now I have another issue. I am selecting a group of object nodes, and one by one the script is pressing the same button on each node. Is there a way for me to check the current node to see if it has cooked and the python script attached to doIt has completed its task? I have been searching the Hou module and have only found cook. From the looks of it,this seems to just cook the node. Does it wait for houdini to finish cooking before the script continues? Quote Link to comment Share on other sites More sharing options...
ivan Posted March 24, 2015 Share Posted March 24, 2015 dusty memory.... how do you press a button in hscript? Quote Link to comment Share on other sites More sharing options...
graham Posted March 24, 2015 Share Posted March 24, 2015 opparm -c 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.