Jump to content

How To press a button through python


Recommended Posts

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?

Link to comment
Share on other sites

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... :blink:

Thanks!

Walt

Link to comment
Share on other sites

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. :lol:

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?

Link to comment
Share on other sites

  • 6 years later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...