Ortho view toggle scrips and key shortcuts

Next
 From:  Duarte Ramos (DUARTEFRAMOS)
6349.1 
So I am really new to MoI, and I usually always work with only one view at the same time maximized (no split layout), and one of the first gripes that caught my attention was that after setting the view point to one of the orthographic (top/left/right/front), I had to press the button 3D again to get back to the 3D view, and could not rotate or orbit the view directly back to perspective or "isometric".
So I figured a way to do this using Shortcut keys and a custom script derived from the fantastic ones available at Petrov's Page http://kyticka.webzdarma.cz/3d/moi/

If, like me, you use only one viewport maximized, instead of setting the active view to top/bottom left/right front/back these scripts set the projection to parallel and use tilt and rotations to set the view position. This allows you to orbit back into 3D (because you actually never left the 3D view in the first place) and also tggle between each view direction with the same key like Top<>Bottom or Left<>Right or Front<>Back using an IF condition:

Hope they are useful to someone else as they are for me
Just copy/paste them and assign to a key of your choosing:

Front/back toggle
script:var vp = moi.ui.mainWindow.viewpanel.getViewport('3D'); vp.projection = 'Parallel'; vp.tiltAngle = 0; vp.upDownAngle = 90; if (vp.leftRightAngle == 0) {vp.leftRightAngle = 180;} else {vp.leftRightAngle = 0;}

Left/Right toggle
script:var vp = moi.ui.mainWindow.viewpanel.getViewport('3D'); vp.projection = 'Parallel'; vp.tiltAngle = 0; vp.upDownAngle = 90; if (vp.leftRightAngle == 90) {vp.leftRightAngle = -90;} else {vp.leftRightAngle = 90;}

Top/Bottom toggle
script:var vp = moi.ui.mainWindow.viewpanel.getViewport('3D'); vp.projection = 'Parallel'; vp.tiltAngle = 0; vp.leftRightAngle = 0; if (vp.upDownAngle == 0) {vp.upDownAngle = 180;} else {vp.upDownAngle = 0;}

Set projection back to perspective or toggle between the two
script:var vp = moi.ui.mainWindow.viewpanel.getViewport('3D'); if (vp.projection == 'Perspective') {vp.projection = 'Parallel';} else {vp.projection = 'Perspective';}
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
6349.2 In reply to 6349.1 
Hi Duarte, also here are some scripts that will let you jump to a particular maximized viewport with one keystroke:
http://moi3d.com/forum/index.php?webtag=MOI&msg=3808.2

Although it is possible to manipulate the 3D viewport to different positions like Top, Right, etc..., it won't be quite 100% the same for drawing things, when you draw things in an ortho view there are various additional 2D drawing aids that will kick in, like you'll get the edit frame for quick scaling and rotation, and once you start drawing something like a curve in the 2D view it will remain planar to that view with things like snap points projected to a plane going through the first point you picked.

Basically there is some additional functionality to help with drawing 2D things when you are in one of the 2D viewports, those things will not be activated if you are still actually in the 3D viewport just with its view happening to be aligned with an ortho view direction.

Just something to be aware of...

- Michael

EDITED: 8 Dec 2013 by MICHAEL GIBSON

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Duarte Ramos (DUARTEFRAMOS)
6349.3 
Oh right, I wasn't aware of that Michael, thanks for the warning, I'll keep that in mind!

For quickly checking the model these are still useful as the can be reversed back to a 3D view simply by orbiting.
That post is very nice, it also answered my questions about setting Numpad keyboard shortcuts!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All