Jump to content

Modify item in OPmenu


DonRomano

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 ?

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