3ds Max C++ API Reference
IOfflineRenderSession Class Referenceabstract

An interface which encapsulates a render session for offline (non-interactive) rendering. More...

#include <IOfflineRenderSession.h>

+ Inheritance diagram for IOfflineRenderSession:

Public Member Functions

virtual bool TranslateScene (const TimeValue t)=0
 Translates or updates the scene at the given time. More...
 
virtual bool RenderOfflineFrame (const TimeValue t)=0
 Renders a single frame of an animation sequence. More...
 
virtual bool StoreRenderElementResult (const TimeValue t, IRenderElement &render_element, IFrameBufferProcessor &frame_buffer_processor)=0
 Processes render elements, one by one, after a frame has been rendered. More...
 
virtual void StopRendering ()=0
 Stops the progressive rendering process at the next possible iteration. More...
 
virtual void PauseRendering ()=0
 Pauses the rendering process. More...
 
virtual void ResumeRendering ()=0
 Resumes the rendering process, following a pause. More...
 
- Public Member Functions inherited from IRenderSession
virtual ~IRenderSession ()
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

An interface which encapsulates a render session for offline (non-interactive) rendering.

This render session is allocated for the duration of an offline rendering session, which consists of rendering one or more animation frames, without the possibility of the user interacting (modifying) with the scene while the renderer is active. This interactive is created when the user initiates an offline render, and destroyed when the rendering operation is completed; this corresponds roughly to calls to Renderer::Open() and Renderer::Close().

Member Function Documentation

◆ TranslateScene()

virtual bool TranslateScene ( const TimeValue  t)
pure virtual

Translates or updates the scene at the given time.

This method is called once per frame to translate (on first frame) or update (on further frames) the scene, in preparation for the frame about to be rendered. It's important that the scene translation be handled by this method (and not by RenderOfflineFrame()), because there are certain system events that must occur between translation and rendering. These system events are handled by the system.

Parameters
tThe time at which the scene is to be translated.
Returns
True on success. False on failure, for any reason - in which case the rendering process will be aborted.

◆ RenderOfflineFrame()

virtual bool RenderOfflineFrame ( const TimeValue  t)
pure virtual

Renders a single frame of an animation sequence.

This is called to render a single frame of an animation sequence, following a call to TranslateScene (not quite immediately, a few things occur in between). Before returning, this method is expected to update the frame buffer with the rendered result (see ICameraContainer::Bitmap()).

Parameters
tThe time at which the frame is being rendered (same value passed to the previous call to TranslateScene()).
Returns
True on success. False on failure, for any reason - in which case the rendering process will be aborted.

◆ StoreRenderElementResult()

virtual bool StoreRenderElementResult ( const TimeValue  t,
IRenderElement render_element,
IFrameBufferProcessor frame_buffer_processor 
)
pure virtual

Processes render elements, one by one, after a frame has been rendered.

Following a successful call to RenderOfflineFrame(), the system iterates over all active render elements and calls this method for each. The implementation is expected to store the result, for each element is supports, using the provided frame buffer processor. Any unsupported render elements should simply be skipped, in which case the renderer may output an error message if it so desires.

Remarks
The render session may skip this mechanism and process its render elements results in the call to RenderOfflineFrame(), if it wishes. It should, then, simply return true from this method. The render elements should then be fetched using IRenderSessionContext::GetRenderElements().
Parameters
tThe time at which the frame is being rendered (same value passed to the previous call to RenderOfflineFrame()).
render_elementThe render element to be processed.
frame_buffer_processorThe interface through which the frame buffer is to be stored. This is optional: the renderer may store the the result directly into the render element's Bitmap, if it wishes so.
Returns
True on success. False on failure, for any reason - in which case the rendering process will be aborted.

◆ StopRendering()

virtual void StopRendering ( )
pure virtual

Stops the progressive rendering process at the next possible iteration.

See Renderer::StopRendering(), from which this call is forwarded.

◆ PauseRendering()

virtual void PauseRendering ( )
pure virtual

Pauses the rendering process.

See Renderer::PauseRendering(), from which this call is forwarded.

◆ ResumeRendering()

virtual void ResumeRendering ( )
pure virtual

Resumes the rendering process, following a pause.

See Renderer::ResumeRendering(), from which this call is forwarded.