Rendering Notifications

#preRender: Array 

Sent before rendering is started. This notification is sent out before the renderer creates the render instance objects, which means that you can create nodes and other objects as a response to this event. When rendering multiple frames, this event is sent only once at the beginning of the rendering phase, and not on a per-frame basis. In the #preRender callback, you can't change any of the render parameters (height, width, aliasing, etc) and affect the current render sessions. Those parameters have already been set up internally in 3ds Max, and so changes to them won't occur until the next render session occurs.

Returns a 28 element array - see the SDK help file, class RendParams, for more information on the parameter definitions.

1 - Name - rpar -> rendType

2 - Boolean - rpar -> isNetRender

3 - Boolean - rpar -> fieldRender

4 - Integer - rpar -> fieldOrder

5 - Time - rpar -> frameDur

6 - Boolean - rpar -> colorCheck

7 - Integer - rpar -> vidCorrectMethod

8 - Integer - rpar -> ntscPAL

9 - Boolean - rpar -> superBlack

10 - Integer - rpar -> sbThresh

11 - Boolean - rpar -> rendHidden

12 - Boolean - rpar -> force2Side

13 - Boolean - rpar -> inMtlEdit

14 - Float - rpar -> mtlEditTile

15 - Boolean - rpar -> mtlEditAA

16 - Boolean - rpar -> multiThread

17 - Boolean - rpar -> useEnvironAlpha

18 - Boolean - rpar -> dontAntialiasBG

19 - Boolean - rpar -> useDisplacement

20 - Boolean - rpar -> useRadiosity

21 - Boolean - rpar -> computeRadiosity

22 - TextureMap - rpar -> envMap

23 - Time - rpar -> firstFrame

24 - Integer - rpar -> scanBandHeight

25 - Integer - rpar -> extraFlags

26 - Point2 - rpar -> width, rpar -> height

27 - Boolean - rpar -> filterBG

28 - Boolean - rpar -> alphaOutOnAdditive

#postRender: undefined 

Sent after rendering has finished. This notification is sent out after the renderer destroys the render instance objects, which means that you can create nodes and other objects as a response to this event. When rendering multiple frames, this event is sent only once at the end of the rendering phase, and not on a per-frame basis.

#preRenderEval: time 

Sent just before the renderer starts evaluating objects.

Returns the time being rendered

#preRenderFrame: Array 

Sent just before each frame is rendered by the renderer. This notification is sent out after the renderer has taken a snapshot of the scene geometry. At the time of this call the scene cannot be modified. The renderer has already called GetRenderMesh() on all the object instances, and the materials and lights are already updated. If you don't modify anything that is rendered, then it is okay to use this callback. The current frame being rendered is set into the MAXScript currentTime context and system global, so any references to other scene object properties will automatically be resolved at the currently rendering frame's time. This notification is not sent out when the renderer is called to update the Material Editor sample spheres, only during output rendering.

#postRenderFrame: Array 

Sent just after each frame is rendered by the renderer. The current frame being rendered is set into the MAXScript currentTime context and system global, so any references to other scene object properties will automatically be resolved at the currently rendering frame's time. This notification is not sent out when the renderer is called to update the Material Editor sample spheres, only during output rendering.

Returns a 22 element array - see the SDK help file, class RenderGlobalContext, for more information on the parameter definitions.

1 - Integer - rendParams -> projType

2 - Point2 - rendParams -> devWidth, rendParams -> devHeight

3 - Point2 - rendParams -> xscale, rendParams -> yscale

4 - Point2 - rendParams -> xc, rendParams- > yc

5 - Boolean - rendParams -> antialias

6 - Matrix3 - rendParams -> camToWorld

7 - Matrix3 - rendParams -> worldToCam

8 - Point2 - rendParams -> nearRange, rendParams -> farRange

9 - Float - rendParams -> devAspect

10 - Float - rendParams -> frameDur

11 - TextureMap - rendParams -> envMap

12 - Color - rendParams -> globalLightLevel

13 - Time - rendParams -> time

14 - Boolean - rendParams -> wireMode

15 - Float - rendParams -> wire_thick

16 - Boolean - rendParams -> force2Side

17 - Boolean - rendParams -> inMtlEdit

18 - Boolean - rendParams -> fieldRender

19 - Boolean - rendParams -> first_field

20 - Boolean - rendParams -> field_order

21 - Boolean - rendParams -> objMotBlur

22 - Integer - rendParams -> nBlurFrames

#beginRenderingReflectRefractMap: undefined 

Sent before preparing Reflect and Refract Maps for rendering

#beginRenderingActualFrame: undefined 

Sent after render setup and immediately before the actual render begins

#beginRenderingTonemappingImage: undefined 

Sent before rendering Tonemapping image

Warning:

You cannot change an object's mesh in a #preRenderFrame , #postRenderFrame or any of the #beginRendering* callbacks, particularly if the mesh isn't animated. The renderer has already evaluated the original mesh and holds a pointer to that mesh. Changing the object's mesh will delete the old mesh, but the renderer doesn't know this, and when trying to render the now deleted mesh will crash.

EXAMPLE:

For an example of using the #preRender and #postRender callbacks, see

How To ... Change Objects At Render Time