Jump to content

How to execute shelf button via python?


haggi

Recommended Posts

Thanks, that was fast.

Unfortunately I have problems with both methods. The first method gives me (with a simple test tool which creates a sphere):

>>> st = hou.shelves.tool("converter")
>>> s=st.script()
>>> exec(s)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "<string>", line 12, in <module>
NameError: name 'kwargs' is not defined
>>> 

And the other one seems only to work from within the UI, but I'd like to execute the shelf button from hython commandline.

Link to comment
Share on other sites

Yeah I see, I'm getting this error too, because I guess the shelf tool needs some sort of info to set up kwargs and executing it from a script doesn't seem to give it the info. Why not creating a normal  script and then executing it with hython instead of creating a shelf tool ?

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