Home Technical Talk

3ds max: Toggle perspective/orthographic view

I usually have the perspective mode set to space bar but I frequently need to go between this view and orthographic mode. Is it possible to set the space bar so that it toggles between these two view modes?

Replies

  • Mark Dygert
    Yep, but you probably need to do it through maxscript with simple IF THEN ELSE statement.
    IF the viewport isn't in perspective, THEN change it to Pers, ELSE change it to Ortho.
    Then each time you call the script it will switch.


    I covered a 3 state toggle in the maxscript write up I did a while back. It covers something very similar, changing the viewport FOV between 3 states. You can slim it down to suit your needs.
    http://www.polycount.com/2011/05/16/maxscript-for-newbies/#more-5510

    Once you get the toggle working, you create a macroscript (also covered in the write up) and then you can bind it to a key.

    EDIT: The script would look like this (minus the macroscript header):
        if gw.isPerspectiveView() == false then ( [SIZE=1][COLOR=SeaGreen][I]-- checks the viewport, returns true/false[/I][/COLOR][/SIZE]
            max vpt persp user [SIZE=1][COLOR=SeaGreen][I]-- if false, changes the viewport to pers[/I][/COLOR][/SIZE]
            )
            else (
                max vpt iso user [SIZE=1][COLOR=SeaGreen][I]-- if true, changes the viewport to ortho[/I][/COLOR][/SIZE]
            )
    
    You can copy/paste this code into a new maxscript and then drag it from there into the toolbar to create a button, or you can create a macroscript header like I outlined in the write up to be able to bind it to a key. Very helpful stuff if you start customizing max this way.
  • scourgewarper
    I always wanted to be able to use the toggle feature used for the selection modes and I guess you can apply this principle to most of the other tools/features in max - very helpful thanks :)
Sign In or Register to comment.