Jump to content
B.Walters

Adding Scripts To Rmb Click-menu

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Just as I was coming back to post "Nevermind, I found it!"...

But thanks Adam!

Share this post


Link to post
Share on other sites

jsut a quick questionk, is it possible to link to a python script instead of a cmd. I tried, but without success

Share this post


Link to post
Share on other sites

jsut a quick questionk, is it possible to link to a python script instead of a cmd. I tried, but without success

No. sadly thats not possible currently. cmd that calls your python is the only way for now.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

I used a wrapper like Graham describes that pops up a small hou.ui.selectFromList.

The wrapper collected various python scripts depending on the node type via a simple plugin system.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×