Maximizing Outliner

Ok, so I have not done a lot of coding with GUI and window stuff… I was hoping someone could point me in the right direction or give me a hint at what I need to do.

I am trying to maximize the outliner in the main window for when I am baking animation out. I know how to create an outliner via:

if “outlinerPanel1” not in cmds.getPanel(vis=1):
cmds.OutlinerWindow()

But I am not sure how to throw that Outliner into main viewport and maximize it… then minimize it after done.

are you doing this to speed things up while baking? if so, just use this:


class SuspendViewport(object):
    def __enter__(self):
        cmds.refresh(su=True)
        return self
    def __exit__(self, exc_type, exc_value, traceback):
        cmds.refresh(su=False)

## -- And use it like

with SuspendViewport():
    ## -- Bake your animations

This is a little verbose, but you can reuse that context manager all over the place. If you dont want to go that route, just wrap the refresh command in a try/finally block