Jump to content

python - otl button - make the button press other button


Juzwa

Recommended Posts

Hi, 

So inside my otl there is a ROP Output Driver. I want my otl button to make press the save button on the ROP Output Driver. 

So I have this button: '/obj/MyOTL/save'

And want to control this button: '/obj/MyOTL/rop_output_driver/execute'

I've been trying for some time now but I just cant find the function to simply press a button :)

Link to comment
Share on other sites

You can basically just set up a Python callback on your save button that does one of two things:

- Calls hou.Parm.pressButton() on the execute parameter on your ROP node: hou.pwd().node("rop_output_driver").parm("execute").pressButton()

- Calls hou.RopNode.render() on the ROP node itself: hou.pwd().node("rop_output_driver").render()

Both are basically equivalent as the button is going to invoke the render method of the node

Link to comment
Share on other sites

Okay. So I have now two buttons in my OTL. Save and Force Load (this is just a reload in file SOP)

Save Button: hou.pwd().node("save_constraints").parm("execute").pressButton()

Force Load Button: hou.pwd().node("read_constraints").parm("reload").pressButton()

Save button works perfectly all the time, no matter how many otls I have. But The load button... sometimes it work and sometimes not. Usually I have to dive into OTL, manually press reaload, and then the Force Button will start working. As long I'm using the same OTL. When I change the working OTL its the same story. Have to dive in, manually press reload...

 

Link to comment
Share on other sites

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