Guest mantragora Posted May 13, 2013 Share Posted May 13, 2013 (edited) Hi. I got two HOWTO questions: 1) In DA you just specify TAB submenu path and you are ready to go, but I can't find anything similar in HDK when I'm adding operator. I suppose it is somewhere in OP_OperatorTable, but which function does that ? I don't see Tab submenu path function there . 2) In python you can pass use_existing_selection=False to the selector and it will not reuse already selected geometry. I can't find the same functionality in HDK selector. There are probably simple solutions for those two questions. Thanks in advance. Edited May 13, 2013 by mantragora Quote Link to comment Share on other sites More sharing options...
edward Posted May 14, 2013 Share Posted May 14, 2013 2) See OP3D_InputSelectorBase::allowFinishWithExistingSelection() Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted May 14, 2013 Share Posted May 14, 2013 (edited) You came, You saw, You solved . Thank you. Only one to go. Anyone knows how to solve first question? Edited May 14, 2013 by mantragora Quote Link to comment Share on other sites More sharing options...
lisux Posted June 19, 2013 Share Posted June 19, 2013 Only one to go. Anyone knows how to solve first question? Yep, you can't I submitted a RFE more than a year ago to add this feature to OP_OperatorTable. Still waiting, last time I checked with support they told they are working on it. You have the same problem if you code a VEX node from scratch and compile it using vcc, noway to put your node inside a submenu.(AFAIK) Cheers Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted June 20, 2013 Share Posted June 20, 2013 Haha, thanks for info. Good to know about RFE. Quote Link to comment Share on other sites More sharing options...
graham Posted June 20, 2013 Share Posted June 20, 2013 All Houdini nodes and tools have their tool information (including Tab menu settings) defined in tool definitions. This includes all HDK compiled nodes (both custom and SESI built). To have anything other than your compiled operator showing up in the 'Custom' tab menu you will have to build your own tool definition and shove it in a toolbar/ folder in the Houdini path. For digital assets, when you edit the menu location on in the Type Properties you are modifying the definition in the Tools.shelf section of the definition. When Houdini starts up, tools from otls are loaded so the nodes become available to you. When Houdini starts up and sees something like an HDK operator and can not find any pre-defined tools it will generate a very basic default tool to allow the node to be instantiated. Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted June 20, 2013 Share Posted June 20, 2013 (edited) I suppose this is not the same toolbar definition like *.shelf file? Or is it and you just use different XML attributes there? Is there example somwhere of such a file somewhere? Is there full specification of all attributes that are available in *.shelf format somewhere? Edited June 20, 2013 by mantragora Quote Link to comment Share on other sites More sharing options...
graham Posted June 20, 2013 Share Posted June 20, 2013 I don't think there is any real documentation about writing them. Your best bet is to either look through $HFS/houdini/toolbar to see all Houdini's default tools, or to just create a new tool on the shelf, add a bunch of settings to it then look at the corresponding generated .shelf file. You can pick and choose elements from the files and basically create your own. Here's an example of a simple .shelf file containing a tool for a compiled operator. https://github.com/captainhammy/Houdini-Toolbox/blob/master/SOP/SOP_PrimGroupCentroid/sop_primgroupcentroid.shelf Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted June 20, 2013 Share Posted June 20, 2013 Thank you, it works. The only problem is that now I got operator available in both, Custom and MANTRAGORA submenu. Quote Link to comment Share on other sites More sharing options...
graham Posted June 21, 2013 Share Posted June 21, 2013 My guess would be your custom tool isn't quite named correctly to cause Houdini to recognize it as being for your operator and not building a default tool. Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted June 21, 2013 Share Posted June 21, 2013 (edited) So I've trying to figure out how the attributes should be used. Let's say we got tool with: - internal name => "hdk_createpolygon" <= this is the same name you will see if you MMB on your operator under "Operator type". - external name => "HDK CreatePolygon" <= this is the name we see on the interface Now let's fill the data: <?xml version="1.0" encoding="UTF-8"?> <shelfDocument> <tool name="sop_createpolygon" label="CreatePolygon" icon="SOP_CreatePolygon"> <helpURL>operator:Sop/hdk_createpolygon</helpURL> <toolMenuContext name="viewer"> <contextNetType>SOP</contextNetType> </toolMenuContext> <toolMenuContext name="network"> <contextOpType>Sop/hdk_createpolygon</contextOpType> </toolMenuContext> <toolSubmenu>MANTRAGORA/HDK</toolSubmenu> <script scriptType="python"><![CDATA[import soptoolutils soptoolutils.genericTool(kwargs, 'hdk_createpolygon', allow_obj_sel=False)]]></script> </tool> </shelfDocument> Now, as I understand, all attributes in this line <tool name="foo" label="Foo" icon="FooIcon"> can be filled with different data than our internal/external name and icon we specified in the C++ code, we use this to specify how our tool will be named when moved to MANTRAGORA/HDK submenu. I suppose we can also use the same names as we specified in C++. In both cases I still get tool in both, Custom and MANTRAGORA/HDK submenus. Is there anything else that can be wrong? Edited June 21, 2013 by mantragora Quote Link to comment Share on other sites More sharing options...
graham Posted June 21, 2013 Share Posted June 21, 2013 The tool name is of this form: {context}_{internal_name} So In your case you should name your tool: "sop_hdk_createpolygon". Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted June 21, 2013 Share Posted June 21, 2013 The tool name is of this form: {context}_{internal_name} So In your case you should name your tool: "sop_hdk_createpolygon". F*ck yeah! Works. Thank you! Quote Link to comment Share on other sites More sharing options...
milla_g Posted October 1, 2015 Share Posted October 1, 2015 Hi there, I know the topic is quite old, but I've decided to ask here anyway, since things might have changed with newer versions of houdini. Basically my problem is that I'm trying to implement a vop network where only custom vop nodes are allowed and only those should show up in the tab menu. Most of the vops inherit from a custom base class and are generated automatically. So what I've ended up with is - in the tab menu there is single submenu "Custom" where all allowed vops can be found. Is there any other way I could customise the tab menu without generating a tool definition for every vop that I have and place it under houdini/toolbar folder? What would be the best approach here? Thanks. Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted October 1, 2015 Share Posted October 1, 2015 (edited) No. Every node have generated tool definition. Even when you modify Digital Asset and you modify TAB Submenu Path, under the hood there is a Tool.shelf file modified that is included inside of HDA. EDIT: To expand a little on this, I've been thinking about XML config file for my tools, instead of header file where I #define all parameter names, tooltips etc. So once Houdini launches, it reads file and sets the names. It would allow easy name changing if there is existing tool in some pipeline with specified name, without the need for recompilation. This XML file could be also used to easily generate tool definition files with some additional script (added to compilation stack at the end for automation). Maybe you could go this way. Edited October 1, 2015 by fântastîque Mântragorîè Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.