Notifications
Clear all

[Closed] Cycle viewports script care of BOBO

Bobo wrote this script so I could assign my spacebar to cycle through the viewports. I have been using it for awhile now and really like it. Thought I would include it in the scripts section for everyone, if you would like to try it also. You can also change the “viewNames = #” line to cycle other views too, like right or bottom. So the spacebar cycles the:

 P = Perspective
 L = Left
 T = Top

B = Back


   macroScript CycleView category:"Forum Help"
   (
   viewNames = #(#view_persp_user, #view_left, #view_top, #view_back)
   theType = findItem viewNames (viewport.getType())
   theType += 1
   if theType > viewNames.count do theType = 1
   viewport.setType viewNames[theType]
   )
    
*Copy.
*Paste into a new Script Editor.
*Evaluate (Ctrl+E)
*Assign whatever shortcut you want to CycleView in the "Forum Help" category.
*Press the shortcut to cycle the current view.
3 Replies

i love it , thanks for sharing

Just a note:

Here are all possible values for viewport types as seen in the MAXScript Reference:

[left]#view_top [color=green]– Top[/color]
[/left]
[left]#view_bottom [color=green]– Bottom[/color]
[/left]
[left]#view_right [color=green]– Right[/color]
[/left]
[left]#view_left [color=green]– Left[/color]
[/left]
[left]#view_front [color=green]– Front[/color]
[/left]
[left]#view_back [color=green]– Back[/color]
[/left]
[left]#view_persp_user [color=green]– Perspective[/color]
[/left]
[left]#view_iso_user [color=green]– User[/color]
[/left]
[left]#view_camera [color=green]– Camera[/color]
[/left]
[left]#view_spot [color=green]– Light[/color]
[/left]
[left]#view_shape [color=green]– Shape[/color]
[/left]
[left]#view_grid [color=green]– Grid[/color]
[/left]
You can place any combination of them into the array to switch to other views using the script.

You still rock Bobo. Thank you very much for your help!