Jump to content

tab sub menu path using python


newbee

Recommended Posts

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
Link to comment
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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...