Maxwell Camera Offset Script
Update 1: I fixed a small bug since the original release that would cause the view to be a little bit inaccurate to the rendered image. If you are having problems with accuracy, download the latest version at the link above and it should be fixed.
I’m happy to release my latest and greatest Maxscript, this one for displaying the Maxwell camera offset value visually in the viewport! Only being able to see the offset in a render makes it hard to adjust, so I’ve written a script that adjusts the viewport to show that offset.
This script installs just a little bit differently than the last one. It is distributed as a .mzp file, which is just a zip compressed maxscript file (if you want to see the source code, you can just rename it with a .zip extension and open it up as usual). Run the script as normal from Max (see my explanation if you are new to this) and choose the .mzp file. Now restart Max, and a little toolbar should pop up once it gets warmed up.
Here is a preview of the camera+ toolbar and the offset dialog.
- The dropdown lists the cameras in your scene. Choosing one from the dropdown sets the current viewport to that camera and also updates the values for the offset. If you change viewports manually to a camera view, this dropdown will update accordingly.
- The camera button (shown blue here) turns blue when the offset is active. Toggle the button for on / off.
- Make sure you have safe frames turned on so the viewport will be cropped correctly!
- The lock button turns on or off the transform locks so the camera can’t be moved using the gizmo. Note that it can be moved still by panning / zooming / rotating when looking through it in the viewport. I haven’t found any way to disable that movement.
- The third button opens up a dialog where you can control the offset values using a slider or spinner control.
- There’s also a button in the offset dialog that just sets the camera target to be level with the camera and remove any perspective distortion.
- Warning: Because the script modifies the render image settings to get the offset right, you shouldn’t change these settings yourself while the offset is active. To change the image dimensions, first disable the offset (it will return your settings to normal), then change the dimensions and re-apply the offset if you wish.
And here’s a sample of what a scene looks like with the offset on. Because of the way Max stores camera values, it’s not so simple to offset the viewport. The best compromise I’ve found is to stretch the dimensions of the render settings and then “mask” the part that will not be visible. That masking is done with a plane that is linked to the camera and created / deleted as necessary. It’s kind of a hack, but the only way I’ve found so far to allow you to move the camera with the offset of, and not distort the perspective by moving the target up and down.
That’s all there is to it! This is just the first in a planned set of camera tools I’m planning on rolling into this toolbar, check back every once in a while as I will be adding exposure, focus, z-depth and image dimension / naming tools to it.
And if you find any bugs, leave a comment here or send me an e-mail and I’ll get right on it.