How to search for a shelf tool?

   Views 639   Replies 4   Subscribers 0
User Avatar
Member
540 posts
Joined: Aug. 2019
Offline
For example, I've noticed that since H20, Quad Remesh SOP has a shelf tool:

radialmenu.runShelfTool(kwargs, 'sop_quadremesh')

But I can't find which shelf it is located. Is there a way to to search for a specific shelf tool?
Edited by raincole - June 25, 2024 08:03:43
User Avatar
Member
318 posts
Joined: Jan. 2013
Offline
Basic module for working with shelves.
https://www.sidefx.com/docs/houdini/hom/hou/shelves.html [www.sidefx.com]
hou.shelves.tool("sop_quadremesh").filePath()
hou.shelves.tool("sop_quadremesh").toolMenuLocations()
But it's a contextual tool, you won't find it on the shelf.
User Avatar
Member
540 posts
Joined: Aug. 2019
Offline
alexwheezy
hou.shelves.tool("sop_quadremesh").toolMenuLocations()

Thank you for the answer. That being said, I'm still not sure what "contextual tool" is... what's the difference between a contextual tool and a shelf tool? Can I create a contextual tool or it's hardcoded in Houdini?
User Avatar
Member
318 posts
Joined: Jan. 2013
Offline
raincole
alexwheezy
hou.shelves.tool("sop_quadremesh").toolMenuLocations()

Thank you for the answer. That being said, I'm still not sure what "contextual tool" is... what's the difference between a contextual tool and a shelf tool? Can I create a contextual tool or it's hardcoded in Houdini?

SOP_Qauadremesh is indeed defined in SopStateTool.shelf, but that doesn't mean you can create this shelf directly. As you can see this shelf uses the state viewer for activation.

You can borrow a piece of code for your shelf to have similar functionality.

<tool name="sop_quadremesh" label="Quad Remesh (Beta)" icon="SOP_quadremesh">
<helpURL>operator:Sop/quadremesh</helpURL>
<toolMenuContext name="viewer">
<contextNetType>SOP</contextNetType>
</toolMenuContext>
<toolMenuContext name="network">
<contextOpType>Sop/quadremesh</contextOpType>
</toolMenuContext>
<toolSubmenu>Geometry/Polygons</toolSubmenu>
<toolSubmenu>Geometry/Polygons/Topology</toolSubmenu>
<script scriptType="python"><![CDATA[import soptoolutils

soptoolutils.customStateTool(kwargs, 'quadremesh')]]></script>
</tool>

import soptooltuils
soptoolutils.customStateTool(kwargs, 'quadremesh')
User Avatar
Member
540 posts
Joined: Aug. 2019
Offline
I see. Never realize there is that special kind of shelf. Thank for the explanation.
  • Quick Links