Scripted camera plug-ins can be written in MAXScript. At present, you can write either extending camera plug-ins that extend the existing MAX cameras or temporary camera plug-ins that can be used to host create tools for a custom camera system.
The plug-in superclass for cameras is 'camera'.
This event handler is available to scripted cameras and gives access to the CameraObject:: renderApertureChanged callbacks made by the rendering dialog to a camera when the user adjusts parameters that affect the render aperture.
The 'val' parameter contains the new render aperture value. This typically gets called when you select a new aperture in the Output Size dropdown in the render dialog or adjust a spinner when in Custom mode.
There are several cases where this handler is called:
In the Render Scene dialog, if Image Aspect is unlocked and you change the Width, Height, or Pixel Aspect
In the Render Scene dialog, if you click on one of the output size preset buttons
In the Render Scene dialog, if Image Aspect is locked and you change the Width, Height, or Pixel Aspect, or if you change Aperture Width, and then click on either Render or Close
The value being passed into handler is the aperture width. You can get the remaining values using the renderWidth , renderHeight , and RenderPixelAspect global variables. However, what you get for these values are typically the old value with the exception of the Aperture Width value. The call to the handler is coming from a "InvalidateCameras" method, which is called right before setting the new values. No broadcasts are made after the new values are set, and if safe frames are not turned on in any viewport, none of the viewports are redrawn.
It is recommended that if a scripted camera uses this handler, it must cache the old Aperture Width value and test the incoming value against the cached value before proceeding.
The following handler was added in 3ds Max 7:
This event handler is available to scripted cameras and helpers, and lets the developer replace the viewport display mesh of the delegate with a custom display mesh.
The example below shows how to update the mesh in the handler only when the mesh has actually changed:
This optional event handler lets the developer specify whether to use the node's wire color when drawing the object in the viewport, or use the UI color for the object type (Camera Object for Cameras). If this handler returns true, the node's wire color is used, otherwise the UI color for the object type is used. If the event handler is not specified, the wire color is used. This handler is only applicable when a getDisplayMesh handler is supplied. Available in 3ds Max 8 and higher.