Jump to content
DonRomano

Modify item in OPmenu

Recommended Posts

Hey guys,

I try to modify a few items in the OPmenu (the menu triggered when right-clicking on nodes). I want to modify the expressions that enable certain items, for example disabling the Type Properties... for specific nodes.

Following the documentation, I came up with the following xml file that is in a directory in the HOUDINIPATH

<?xml version="1.0" encoding="UTF-8"?>
<menuDocument>    
    <menu>
        <modifyItem id="opmenu.properties">
            <context>
                <expression><![CDATA[
# some example python code to evaluate an expression
expression = node.type().name() == "custom_nodetype_name"
return expression
                ]]></expression>
            </context>
        </modifyItem>
    </menu>
</menuDocument>

And Houdini returns an error when firing the menu, telling it cannot find element "opmenu.properties". I tried with other items I've found in the "internal" OPmenu.xml file, and I keep having the same error.

Anyone has any hints on this ?

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

×