Skip to content

Instantly share code, notes, and snippets.

@stevechap416
Created May 16, 2018 20:46
Show Gist options
  • Save stevechap416/8d4fb9237293d6082474cfca3bd0d9d9 to your computer and use it in GitHub Desktop.
Save stevechap416/8d4fb9237293d6082474cfca3bd0d9d9 to your computer and use it in GitHub Desktop.
Maxscript: Rotate camera and redraw viewpoint.
/*
This snippet here was created based on specific need to *maybe* rotate the camera 90 degrees before doing some other action.
*/
--Set some globals
global stopRotating = false
global resetAngleAmount = 0
--Camera to manipulate has been added to max scene and is named
camName = "STUDIO_Camera"
--Make sure we are affected the correct camera
for i = 1 to cameras.count do (
if cameras[i].name == camName do (
)
--Ask if the camera needs to be rotated.
if (queryBox "Correct side?" != true and stopRotating != true) then (
rotate cameras[1] (angleaxis -90 [0,0,1])
resetAngleAmount = 90
redrawViews()
if (queryBox "Correct side?" != true and stopRotating != true) then (
rotate cameras[1] (angleaxis -90 [0,0,1])
resetAngleAmount = 180
redrawViews()
if (queryBox "Correct side?" != true and stopRotating != true) then (
rotate cameras[1] (angleaxis -90 [0,0,1])
resetAngleAmount = 270
redrawViews()
if (queryBox "Correct side?" != true and stopRotating != true) then (
rotate cameras[1] (angleaxis -90 [0,0,1])
resetAngleAmount = 0
redrawViews()
) else (
stopRotating = true
)
) else (
stopRotating = true
)
) else (
stopRotating = true
)
) else (
stopRotating = true
)
redrawViews()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment