Jump to content
lamer3d

Expand collapsed toolbars with Python

Recommended Posts

I haven't seen a function for this inside HOM but there is in hscript, which you can call from python.

http://www.sidefx.com/docs/houdini/commands/viewerstow.html

This should work:

 

import toolutils

def viewName(viewer):
    '''
    Returns the Scene viewer name in a hscript compatible format
    '''
    name = {
        'desktop' : viewer.pane().desktop(),
        'pane' : viewer.name(),
        'type' :'world',
        'viewport': viewer.curViewport().name()
    }
    # special case for floating windows - they don't belong to desktops
    if name['desktop']==None:
        name['desktop'] = '*'
    else:
        name['desktop'] = name['desktop'].name()

    return '{desktop}.{pane}.{type}'.format(**name)
        
        
viewer = toolutils.sceneViewer()
hscriptViewer = viewName(viewer)
cmd = "viewerstow -t open -b open -l open -x open -m open -c open -d open %s" % hscriptViewer
hou.hscript(cmd)

 

Edited by Luijee
comment
  • Like 1

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

×