Selecting the Active Viewport script or hotkey

I working in a multi-viewport layout. How can I switch between two viewport windows using a script? Perhaps there are already hotkeys for this action?

Comments

  • OmnifluxOmniflux Posts: 377

    There are hotkeys (Actions) to switch which camera is used in the active viewport, but I don't think there are hotkeys (Actions) to select which viewport is active.

    You could create actions using a script to do this, see DzViewportMgr::setActiveViewport, and then assign hotkeys to these actions.

  • Omniflux said:

    There are hotkeys (Actions) to switch which camera is used in the active viewport, but I don't think there are hotkeys (Actions) to select which viewport is active.

    You could create actions using a script to do this, see DzViewportMgr::setActiveViewport, and then assign hotkeys to these actions.

    Thanks, but I'm not good at scripts. I thought that such a simple thing as switching between windows should be the default. I would be grateful for an example script.

  • OmnifluxOmniflux Posts: 377

    Attached is a script to create actions for setting the default viewports active. You should only need to run the script once, the actions should be saved when you exit DS.

    It will setup hotkeys Ctrl-Shift-# if those hotkeys are not already in use.

    To set other hotkeys after running the script, go to Window -> Workspace -> Customize. In the Action tab, expand the Custom action group and look for Viewport #. Right click on the action and select Change Keyboard Shortcut, then press the shortcut keys you want to set. Click Accept when done.

    dsa
    dsa
    Create Viewport Actions.dsa
    2K
Sign In or Register to comment.