How to choose which scene view pane to be an active one

   1516   2   1
User Avatar
Member
6 posts
Joined: 9月 2018
Offline
I have two Scene View panes,
shelf tools and viewport isolator will always operate on the first Scene View pane.
How to set the second Scene View pane as the active viewport instead??
User Avatar
Member
143 posts
Joined: 1月 2016
Offline
Hi asuralhp, it is hardcoded, for example here (image is attached):
C:\Program Files\Side Effects Software\Houdini 18.0.353\houdini\python2.7libs\toolutils.py

You could probably find all those tools and edit them. Or RFE this.

You can also create 456.py script and swap your Scene Viewer panes on each scene load. I mean … you save the Desktop in a “wrong swapped way” and on each scene load (456) you swap it to the “right way”. Something like this:

hou.ui.curDesktop().panes()[2].splitSwap()
Edited by ikoon - 2020年7月3日 02:27:54

Attachments:
sceneviewer.PNG (62.6 KB)

User Avatar
Member
143 posts
Joined: 1月 2016
Offline
I tried to create the 456.py script. We also have to check, if the swap is needed. Also the execution probably has to be deferred, because we have to wait for the UI to be loaded? I am open for any comments or recommendations as I am no python guru. Especially the deferred execution and lambda is still a bit mysterious for me. Anyways, this works in my case:


# this is the 456.py file, located here:
# C:\Users\NAME\Documents\houdini18.0\scripts\456.py
# https://www.sidefx.com/docs/houdini/hom/locations.html#startup

import hdefereval

def functionToBeExecutedOnStartup():
    # check if swap is needed 
    # the top left panetab in my "wrong swapped desktop" is the ChannelEditor)
    if hou.ui.curDesktop().panes()[0].tabs()[0].type() == hou.paneTabType.ChannelEditor :
        hou.ui.curDesktop().panes()[2].splitSwap()
    
# executeDeferred, because we have to wait for the UI?
hdefereval.executeDeferred(lambda: functionToBeExecutedOnStartup())
  • Quick Links