Notifications
Clear all

[Closed] Possible to script a front/back toggle for view?

Hi, I was wondering if it is possible to create a script that does the following.

Basically if I am in any other view (perspective, user, etc), the hotkey will take me to the Front Orthogonal view. But, if I am already in the front view, then the hotkey will take me to the Back Orthogonal view. If I am in the Back View, it will toggle to the Front View.

I’m guessing the structure would be something like

IF in the front view -> go to the Back View

ELSE -> go to the Front View

Right now I’m only able to bind a key to either the Front or Back View. It would be cool to set them to same key. If I could get somethign like that working, then I could set similar keys for the Left/Right Views, and the Top/Bottom Views. I think it would be very handy

I’m using Max9 btw, thanks for any insight!

2 Replies

That’s easy.

I’m not sure it’s handy to change from perspective to front? Would it be better to cycle the camera’s in the scene. But, swapping from front to back is handy when your modelling.


  macroScript M3D_SwapViewport
  	category:"Mathew3D.com"
  	toolTip:"Swap Viewport"
  	Icon:#("ViewportNavigationControls",9)
  (
  	before = #(#view_persp_user,#view_iso_user,#view_front,#view_back,#view_top,#view_bottom,#view_left,#view_right)
  	after = #(#view_front,#view_front,#view_back,#view_front,#view_bottom,#view_top,#view_right,#view_left)
  	for i=1 to before.count do if viewport.getType() == before[i] do (viewport.setType after[i]; return());
  )
  

Thank you mustan9! (again)

This enabled me to set up exactly what I wanted! This is great, thanks!