Jump to content

parmmenu sorting


Magnus Pettersson

Recommended Posts

Hello guys,

Im having some trouble with adding custom code to PARMmenu.xml. I get it to show up in the menu and run fine, but i cant seem to get it into the right position in the list.

I have tried all the <insertBefore> and <instertAfter> and <insertAtIndex> combinations but my item is dead stuck last on the rmb parm list.

Here is my code in PARMmenu.xml in ~/houdini12.1 now:


<menuDocument>
<menu>
<scriptItem id="togglePublishPath">
<label>Toggle scratch/publish path</label>
<insertBefore />
<scriptCode><![CDATA[import parmMenu; reload(parmMenu); parmMenu.togglePublishPath(kwargs)]]></scriptCode>
</scriptItem>
</menu>
</menuDocument>[/CODE]

ps. Is there a way to only show this menu item on string/file parms?

Link to comment
Share on other sites

You need to put your <insertBefore> tag inside of a <modifyItem> tag like so:

&lt;modifyItem&gt;&lt;insertBefore&gt;lock_parm&lt;/insertBefore&gt;&lt;/modifyItem&gt;

See $HH/MainMenuMaster for more info.

There's currently no way to add any sort of filtering to the menu. The best you can do is to have the code that is called check against the parm being a string/file and if not, do nothing.

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