Query tab menu context folders

   2881   3   2
User Avatar
Member
763 posts
Joined: 9月 2011
Offline
Hi,
anyone know a bit of quick python I can use to query the current Tab context folders available when I hit tab in a particular network view context.

i.e in SOP's it would return : “attribute”, “character”,“crowds”, “polygon”,“primitive”…


I can query the submenu path of each all available operators individually to build a list but that would be crazy
Miles Green, Supervising TD, Animal Logic
User Avatar
Member
75 posts
Joined:
Offline
I know this post is ancient, but I'm searching for how to do this now in houdini 16-17.5

I want to return the string in the “Tab Submenu path” section of an OTL/HDA

I am ok with parsing each operator individually.. just can't seem to find the info at all..


-John c.
User Avatar
Member
394 posts
Joined: 5月 2017
Offline
Hi,

You can access it through the HDADefinition class.
So if you have a node selected you could do something like,
import xml.etree.ElementTree as ET
node = hou.node('/currently/selected/node/path')
definition = node.type().definition()
toolssection = definitions.sections()['Tools.shelf']

root = ET.fromstring(toolssection.contents())
for path in root.iter('toolSubmenu'):
    print(path.text)
User Avatar
Member
8 posts
Joined: 8月 2014
Offline
mikelyndon-sesi
Hi,

You can access it through the HDADefinition class.
So if you have a node selected you could do something like,
import xml.etree.ElementTree as ET
node = hou.node('/currently/selected/node/path')
definition = node.type().definition()
toolssection = definitions.sections()['Tools.shelf']

root = ET.fromstring(toolssection.contents())
for path in root.iter('toolSubmenu'):
    print(path.text)

HI Mike, I was wondering if there is any way to set that same value, say for example that I want to set the TAB Submenu Path where the digital asset is stored when I press tab via Python.

Thanks
  • Quick Links