Accessing the Last Rendered Image
getLastRenderedImage [ copy:<bool> ]
The getLastRenderedImage() method returns the last image rendered via Render Scene, Render Last, or Quick Render
as a bitmap value.
If the optional keyword argument copy: is not specified or is set to true in 3ds Max 2009 and higher, the bitmap will be copied into a new bitmap value. If the keyword argument copy: is specified as true , the MAXScript bitmap value will share the renderer's bitmap.
NOTE:
The renderer reuses the last rendered bitmap value when re-rendering with the same
dimensions. If the dimensions have been changed, a new bitmap value will be created.
EXAMPLE:
|
-
Render the scene
-
Run the following code:
|
bm = GetLastRenderedImage copy:false --share the bitmap
display bm
|
|
|
RESULT: The bitmap display will update to reflect the second render.
|
|
|
RESULT: The bitmap display will still reflect the second render because the third render
created a new bitmap value which is not referenced by the variable bm.
You still need to call free bm to release the underlying bitmap from the MAXScript bitmap value if you want the
release to occur before the MAXScript bitmap value is garbage collected.
|