Jump to content

Adding Scripts To Rmb Click-menu


B.Walters

Recommended Posts

Look for this file

$HOUDINI_PATH/houdini/OPmenu

Does anybody know how I can add my own script to the menu you get when you right-click a node?

I've seen it done before... I just haven't been able to figure out how.

Link to comment
Share on other sites

  • 3 years later...

It is possible to use a Python script from OPmenu with a little trickery. The following is an example for performing an action on a digital asset from a class I taught at SESI LA over the summer. The hscript file it calls just executes a python -c call that imports and reloads a module, then calls a function from it passing in the node path.

OPmenu entry:

'Expr: execute("otgetotl -b $opmenu_optype")' debugOTL "Debug OTL" debug.hsc

debus.hsc:

set script = $arg0

set node = $arg1

python -c "import opmenu_wrapper; reload(opmenu_wrapper); opmenu_wrapper.debug('$node');"

Hopefully one day OPmenu will be replaced by an easy to use xml system just like the main menus and parameter versions.

Edited by graham
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...