MoI discussion forum
MoI discussion forum

Full Version: Script reverse view problem

From: noskule
12 Oct 2017   [#1]
Hi all
I have trouble with the script below

script:if ( moi.ui.mainWindow.viewpanel.mode != 'left' ) { moi.ui.mainWindow.viewpanel.mode = 'left' } else { moi.ui.mainWindow.viewpanel.reverseView( 'left' ) };

it works for "top" and "fornt" but not for left/right view.

Has anyone an idea what's the problem
Best Benji
From: bemfarmer
12 Oct 2017   [#2] In reply to [#1]
Hi Benji

I always wonder where a script writer finds their code?
Must be in the code for the view buttons.

.mode seems to be left out?

- Brian
From: Max Smirnov (SMIRNOV)
12 Oct 2017   [#3] In reply to [#1]
Hi Benji,

this script reverts view under a mouse cursor
code:
script:var viewport = moi.ui.getViewportUnderMouse(); viewport.viewpanel.reverseView(viewport.name);

From: Michael Gibson
12 Oct 2017   [#4] In reply to [#1]
Hi Benji, the default name for that view is 'right', and viewpanel.mode is meant to control which of the bottom 5 tabs are active, it returns one of 'split', '3d', 'top', 'front', or 'right'. So for your script there you'd need to put in 'right' instead of 'left', like this:

script:if ( moi.ui.mainWindow.viewpanel.mode != 'right' ) { moi.ui.mainWindow.viewpanel.mode = 'right' } else { moi.ui.mainWindow.viewpanel.reverseView( 'right' ) };

- Michael