Jump to content
Sign in to follow this  
newbee

tab sub menu path using python

Recommended Posts

Posted (edited)

how to set tab sub menu path while creating hda using python

I was able to get it working till here

hda=hou.node('/obj/geo1/myhda')
hdatype = hda.type().definition()
xmlfile=hdatype.sections()
print xmlfile

now this prints out a bunch of lines but I dont see anything regards to tab sub menu path

 

here is a link to a similar thread

https://www.sidefx.com/forum/topic/40864/?page=1#post-183160

Edited by newbee

Share this post


Link to post
Share on other sites

Hi!

The tab menu is part of the default tool, so you have to look at the tool section. You can access it via:

hda=hou.node('/obj/geo1/myhda')
hdatype = hda.type().definition()
tools=hdatype.sections()["Tools.shelf"]

Then you have to update the <toolSubmenu> Insert Path Here </toolSubmenu> Part in the contents via:

# Change Content
content = tools.contents()
print(content)
content = content.replace("<toolSubmenu>Digital Assets</toolSubmenu>","<toolSubmenu>Insert Path Here</toolSubmenu>")
tools.setContents(content)

Here is how the xml is structured:

https://github.com/LucaScheller/VFX-LYNX/blob/master/plugins/SideFX/Houdini/otls/LYNX_fabric.hda/LYNX_8_8Sop_1LYNX__fabric__pattern_8_81.1/Tools.shelf

Cheers,

Luca

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×