is there a way to hide menubar with python or hscript?

   2018   10   2
User Avatar
Member
20 posts
Joined: 12月 2018
Offline
so I tired many ways...
but I can't find any solution for that...

for other panels or shelf I found:
hou.ui.paneTabs()
or
viewerstow -t stow -b stow
then I tried
hou.qt.MenuBar().close()
hou.qt.MenuBar().setvisible(False)

nothing works....
User Avatar
Member
679 posts
Joined: 2月 2017
Offline
Hey JinChaoH,

I use this python snippet to toggle bars and stowbars:

 
b = hou.ui.hideAllMinimizedStowbars()
b = not b

for p in hou.ui.panes():
    p.setShowPaneTabs(not b)
for p in hou.ui.paneTabs():
    if p.type()!=hou.paneTabType.NetworkEditor:
        p.setShowNetworkControls(not b)

    if p.type()==hou.paneTabType.NetworkEditor:
        p.setPref('showmenu',['0','1'][not b])
    elif p.type()==hou.paneTabType.SceneViewer:
        p.showDisplayOptionsBar(not b)
        p.showOperationBar(not b)
        p.showSelectionBar(not b)
        if p.includeColorCorrectionBar():
            p.showColorCorrectionBar(not b)
        if p.includeMemoryBar():
            p.showMemoryBar(not b)
hou.ui.curDesktop().shelfDock().show(not b)
hou.setPreference('showmenu.val',['0','1'][not b])
hou.ui.setHideAllMinimizedStowbars(b)
User Avatar
Member
20 posts
Joined: 12月 2018
Offline
Thanks, this works like charm

yeah I am not really sufficient with houdini document, the information is everywhere

anyway thanks again,
hou.setPreference('showmenu.val',['0','1'][not b])

never able to think that setPreference can do the trick
User Avatar
Member
20 posts
Joined: 12月 2018
Offline
CYTE
hou.setPreference('showmenu.val',)

sorry to bother you agian... well

just wondering where can I find the information about the values like 'showmenu.val'

in the document : https://www.sidefx.com/docs/houdini/hom/hou/setPreference.html
[www.sidefx.com]
there is no information about the "name"

Thanks again
User Avatar
Member
679 posts
Joined: 2月 2017
Offline
Hey JIn_,

sry, I think this code is part of qlib and I have no clue how to put something like that together

Cheers
CYTE
User Avatar
Member
20 posts
Joined: 12月 2018
Offline
hey CYTE:

Thanks a lot
yeah I guess try to look into the qlib is one way.
the
hou.getPreferenceNames
can give some vague idea as well


Cheers
User Avatar
Member
8 posts
Joined: 8月 2018
Offline
1

calling deleteLater() on the toolbar object schedules it for deletion and completely removes it also from the view -> toolbars menu. Note that you won't be able to further use the toolbar after that, for example re-adding it with iface.addToolBar(toolbar) will not work.

toolbar = QToolBar('Test Toolbar')
# Add to main window & to 'View' menu
iface.addToolBar(toolbar)
# Remove from main window & 'View' menu
toolbar.deleteLater()
User Avatar
Member
92 posts
Joined: 8月 2010
Offline
On a related note, is there a way to hide the playbar via Python? It's not in the pane list and I can't see to find anything obvious in the API. thanks!
User Avatar
Member
4512 posts
Joined: 2月 2012
Offline
jbudsberg
On a related note, is there a way to hide the playbar via Python? It's not in the pane list and I can't see to find anything obvious in the API. thanks!

Per SESI's comment this is not possible:

"I don't think we have any ability to hide the playbar at all, so there's nothing to add to HOM for this."

I filed an RFE for this #127072. So bump it up if you wanna see it in Houdini
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
User Avatar
Member
92 posts
Joined: 8月 2010
Offline
thanks for the heads up! best I could find so far is this one:
hou.playbar.showRangeSlider(0)

Edited by jbudsberg - 2023年4月28日 17:50:49

Attachments:
tmp.jpg (43.8 KB)

User Avatar
Member
7 posts
Joined: 4月 2023
Offline
Hello this is Gulshan Negi
Well, you can also try this code to the so.

from PyQt5.QtWidgets import QMainWindow

class MyMainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.menuBar().setVisible(False)

Thanks
  • Quick Links