[Sidefx-houdini-list] HDK OP in non 'Custom' tabmenu folder

Graham Thompson captainhammy at gmail.com
Mon Mar 21 01:18:55 EDT 2011


In this case, with a SOP named 'foo', you should set the tool name to
'sop_foo'.  This associates the tool directly with the operator and
Houdini will no longer generate a default tool that appears in the
'Custom' menu.  By setting the name to 'sop_myCustomSopTool', as you
point out, you are just creating a random tool, labelled 'Foo', whose
code happens to  instantiate a SOP of type 'foo'.

When Houdini launches and begins to load operators (internal, assets,
compiled oprerators) it looks for tools named '(context)_(opname)'
located in .shelf files or inside the digital assets.  If it finds one
that matches it is happy and uses it.  However, when it does not, in
the case of compiled operators, it will generate a temporary and super
generic tool for the session that provides sufficient code to merely
instantiate it.  To override that functionality, be it merely tab menu
placement, menu icon or even additional functionality, we need to name
our tool correctly so as to have it automatically use out settings.

If you look inside $HH/toolbar/SopTools.shelf you'll see what I mean.
It is filled with largely default tool definitions that are generated
by a script when Houdini is built.  These default tool definitions are
only created when Houdini is built if one is not defined for that
operator type inside a .shelf file located in the Houdini build
directory.  This is basically the same process as outlined above,
however the default operators have their tab menu positions defined in
another file when Houdini is built.

On Sun, Mar 20, 2011 at 9:52 PM, Steve Gustafson <sgustafso at gmail.com> wrote:
> Yep. It's a bit unintuitive, but the tab menus can be tweaked with .shelf
> files.
> The shelf script Graham is talking looks something like this (for a custom
> SOP named 'foo'):
>
> file MyCustomSops.shelf:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <shelfDocument>
>
>  <tool name="sop_myCustomSopTool" label="Foo" icon="SOP_foo">
>    <helpURL>operator:Sop/foo</helpURL>
>    <toolMenuContext name="viewer">
>      <contextNetType>SOP</contextNetType>
>    </toolMenuContext>
>    <toolMenuContext name="pop_viewer">
>      <contextNetType>SOP</contextNetType>
>    </toolMenuContext>
>    <toolMenuContext name="network">
>      <contextOpType>Sop/foo</contextOpType>
>    </toolMenuContext>
>    <toolSubmenu>MySubMenu</toolSubmenu>
>    <script scriptType="python"><![CDATA[import soptoolutils
>
> soptoolutils.genericTool(kwargs, 'foo')]]></script>
>  </tool>
> </shelfDocument>
>
> Also note that this doesn't actually /remove/ your operator from the Custom
> tab (I have no idea how to do that!). It's just creating an extra tool in
> the tab menu of your choice that invokes a script to create your node.
>
> On Sun, Mar 20, 2011 at 9:29 PM, Graham Thompson <captainhammy at gmail.com>wrote:
>
>> You need to create a custom tool definition for your compiled
>> operator.  When you compile operators and load them into Houdini, it
>> will create and use a super generic tool if none is found, hence the
>> boring 'Custom' folder.  By creating a custom tool definition you can
>> control the menu placement as well as some other things.  When
>> creating a custom tool definition the tool name must be the operator
>> name prefixed by the context in order for Houdini to associate a tool
>> with an operator.  Examples include "sop_star", "object_mycoolop",
>> "dop_merge".
>>
>> For example, when I load one of my custom compiled object operators,
>> Transform Switch, it appears in the 'Custom' folder and has no tab
>> menu icon.  If I add the tool for that operator to a shelf and then
>> attempt to look at that tool I can see that in this case it is defined
>> in $HOUDINI_TEMP_DIR/hfs7752-0.tmp.  This isn't useful.  However, I
>> can modify this tool and save it somewhere.  I can set the icon to be
>> COMMON_switch and the Tab Submenu Path to be Utility.  Now, if I save
>> the tool to a .shelf file and it in a /toolbar folder somewhere in the
>> $HOUDINI_PATH, when Houdini launches the tool will get picked up and
>> all those settings I defined are reflected.
>>
>> On Sun, Mar 20, 2011 at 7:57 PM, Sebastian H. Schmidt
>> <sebastian.h.schmidt at googlemail.com> wrote:
>> > Hi Everybody,
>> >
>> > when compiling & using an HDK-Operator it shows-up in the 'Custom' folder
>> of
>> > the tabmenu, does somebody knows how to put it into a different folder ?
>> > Thanks!
>> >
>> > Seb
>> > _______________________________________________
>> > Sidefx-houdini-list mailing list
>> > Sidefx-houdini-list at sidefx.com
>> > https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>> >
>> _______________________________________________
>> Sidefx-houdini-list mailing list
>> Sidefx-houdini-list at sidefx.com
>> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>>
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>



More information about the Sidefx-houdini-list mailing list