IRenderPresetsManager Class Reference

IRenderPresetsManager Class Referenceabstract

#include <iRenderPresets.h>

Class Description

See also
Class Renderer, the Render Preset Category Defines
Description:
The Render Preset Manager allows for loading and saving of render presets through the SDK. The manager can be obtained as follows:

GetCOREInterface()->GetRenderPresetsManager();
+ Inheritance diagram for IRenderPresetsManager:

Public Types

enum  RendererSpecifier { kProduction = 0, kMaterial, kActiveShade }
 
enum  NodeRefAction { kUnspecified = -1, kLoadAll = 0, kLoadNonNodeRefMakers = 1, kLoadNone = 2 }
 

Public Member Functions

virtual ~IRenderPresetsManager ()
 Destructor. More...
 
virtual int Save (RendererSpecifier rendSpecifier)=0
 Save selected categories of render presets to the file. More...
 
virtual int Save (RendererSpecifier rendSpecifier, const MCHAR *fileName)=0
 Save selected categories of render presets to the file. More...
 
virtual int Save (RendererSpecifier rendSpecifier, const MCHAR *fileName, BitArray saveCategories)=0
 Save selected categories of render presets to the file. More...
 
virtual int Load (RendererSpecifier rendSpecifier)=0
 Load selected categories of render presets from the file. More...
 
virtual int Load (RendererSpecifier rendSpecifier, const MCHAR *fileName)=0
 Load selected categories of render presets from the file. More...
 
virtual int Load (RendererSpecifier rendSpecifier, const MCHAR *fileName, BitArray loadCategories, NodeRefAction nodeRefAction=kUnspecified)=0
 Load selected categories of render presets from the file. More...
 
virtual int IsFileCompatible (RendererSpecifier rendSpecifier, const MCHAR *fileName)=0
 Check to see if file is compatable with current renderer. More...
 
virtual const MCHARMapIndexToCategory (const MCHAR *fileName, int catIndex)=0
 Retrieve a render presets name based on its ID. More...
 
virtual int MapCategoryToIndex (const MCHAR *fileName, const MCHAR *category)=0
 retrieve a render presets ID based on its name More...
 
virtual const MCHARMapIndexToCategory (RendererSpecifier rendSpecifier, int catIndex)=0
 retrieve a render presets name based on its ID for the current renderers More...
 
virtual int MapCategoryToIndex (RendererSpecifier rendSpecifier, const MCHAR *category)=0
 retrieve a render presets ID based on its name for the current renderers More...
 
virtual BitArray LoadCategories (const MCHAR *fileName)=0
 return a list of all preset category ID's saved in a given preset file. More...
 
virtual Tab< const MCHAR * > LoadCategoryNames (const MCHAR *fileName)=0
 return a list of all preset category names saved in a given preset file. More...
 
virtual BitArray SaveCategories (RendererSpecifier rendSpecifier)=0
 return a list of all preset category ID's that are meaningful to the specified renderer. More...
 
virtual Tab< const MCHAR * > SaveCategoryNames (RendererSpecifier rendSpecifier)=0
 return a list of all preset category names that are meaningful to the specified renderer. More...
 
virtual RenderPresetsContextGetContext ()=0
 Retrieve the current RenderPresetContext. More...
 

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...
 

Member Enumeration Documentation

Enumerator
kProduction 
kMaterial 
kActiveShade 
60  {
61  kProduction = 0,
62  kMaterial,
64  };
Definition: iRenderPresets.h:61
Definition: iRenderPresets.h:62
Definition: iRenderPresets.h:63
Enumerator
kUnspecified 
kLoadAll 
kLoadNonNodeRefMakers 
kLoadNone 
67  {
68  kUnspecified = -1,
69  kLoadAll = 0,
71  kLoadNone = 2,
72  };
Definition: iRenderPresets.h:70
Definition: iRenderPresets.h:71
Definition: iRenderPresets.h:69
Definition: iRenderPresets.h:68

Constructor & Destructor Documentation

virtual ~IRenderPresetsManager ( )
inlinevirtual

Destructor.

75 {;}

Member Function Documentation

virtual int Save ( RendererSpecifier  rendSpecifier)
pure virtual

Save selected categories of render presets to the file.

Remarks
This function has the same effect as selecting "Save Preset..." in "Rendering->Render Setup->Preset" drop-down list in Max
Parameters
rendSpecifierWhich renderer to save the presets of
Returns
RENDER_PRESETS_SUCCESS on success, or one of the RP_ERROR values if an error occurs
virtual int Save ( RendererSpecifier  rendSpecifier,
const MCHAR fileName 
)
pure virtual

Save selected categories of render presets to the file.

Remarks
When calling this function, the user will be presented with a dialog to select which presets to save for the specified render category.
Parameters
rendSpecifierWhich renderer to save the presets of
fileNameThe file to save the user-selected presets to.
Returns
RENDER_PRESETS_SUCCESS on success, or one of the RP_ERROR values if an error occurs
virtual int Save ( RendererSpecifier  rendSpecifier,
const MCHAR fileName,
BitArray  saveCategories 
)
pure virtual

Save selected categories of render presets to the file.

Parameters
rendSpecifierWhich renderer to save the presets of
fileNameThe file to save the user-selected presets to.
saveCategoriesA BitArray specifying the presets categories to be saved.
Returns
RENDER_PRESETS_SUCCESS on success, or one of the RP_ERROR values if an error occurs
virtual int Load ( RendererSpecifier  rendSpecifier)
pure virtual

Load selected categories of render presets from the file.

Remarks
Calling this function has the same effect as selecting "Load Preset..." in "Rendering->Render Setup->Preset" drop-down list in Max
Parameters
rendSpecifierWhich renderer to load the presets for
Returns
RENDER_PRESETS_SUCCESS on success, or one of the RP_ERROR values if an error occurs
virtual int Load ( RendererSpecifier  rendSpecifier,
const MCHAR fileName 
)
pure virtual

Load selected categories of render presets from the file.

Remarks
Calling this function will display a dialog prompting the user to select which presets in fileName to load.
Parameters
rendSpecifierWhich renderer to load the presets for
fileNameA path to file to load the render presets from
Returns
RENDER_PRESETS_SUCCESS on success, or one of the RP_ERROR values if an error occurs
virtual int Load ( RendererSpecifier  rendSpecifier,
const MCHAR fileName,
BitArray  loadCategories,
NodeRefAction  nodeRefAction = kUnspecified 
)
pure virtual

Load selected categories of render presets from the file.

Remarks
Calling this function will pop a dialog prompting the user to select which presets in fileName to load.
Parameters
rendSpecifierWhich renderer to load the presets for
fileNameA path to file to load the render presets from
loadCategoriesThe preset categories to for the specified renderer
nodeRefActionOne of the NodeRefAction enum values
Returns
RENDER_PRESETS_SUCCESS on success, or one of the RP_ERROR values if an error occurs
virtual int IsFileCompatible ( RendererSpecifier  rendSpecifier,
const MCHAR fileName 
)
pure virtual

Check to see if file is compatable with current renderer.

Remarks
For Example: If the user saves a preset for the Default Scanline Renderer, but does NOT choose the category called "Default Scanline Renderer", then the preset is considered incompatible with any other renderer. This is because the renderer itself will not be saved within the preset, so loading the preset will not change which renderer is active; but the render-specific parameters in the preset are not compatible with other renderers.
Parameters
rendSpecifierThe category to check compatability for
fileNameThe saved render preset file
Returns
TRUE if the renderer currently assigned to rendSpecifier can load the presets in fileName
virtual const MCHAR* MapIndexToCategory ( const MCHAR fileName,
int  catIndex 
)
pure virtual

Retrieve a render presets name based on its ID.

Parameters
fileNameThe file containing the preset we are looking for the name to
catIndexThe ID of the category saved in fileName to retrieve the name of
Returns
the name of the specified render preset
virtual int MapCategoryToIndex ( const MCHAR fileName,
const MCHAR category 
)
pure virtual

retrieve a render presets ID based on its name

Parameters
fileNameThe file containing the preset we are looking for the ID for
categoryThe name of the category saved in fileName to retrieve the ID of
Returns
the ID of the specified render preset
virtual const MCHAR* MapIndexToCategory ( RendererSpecifier  rendSpecifier,
int  catIndex 
)
pure virtual

retrieve a render presets name based on its ID for the current renderers

Parameters
rendSpecifierWhich current renderer to query for the preset category name.
catIndexThe ID of the render preset to retrieve the name of
Returns
the name of the specified render preset
virtual int MapCategoryToIndex ( RendererSpecifier  rendSpecifier,
const MCHAR category 
)
pure virtual

retrieve a render presets ID based on its name for the current renderers

Parameters
rendSpecifierWhich current renderer to query for the preset category ID.
categoryThe name of the category to retrieve the ID of
Returns
the ID of the specified render preset if found, else -1
virtual BitArray LoadCategories ( const MCHAR fileName)
pure virtual

return a list of all preset category ID's saved in a given preset file.

Parameters
fileNameThe file to query for saved preset categories
virtual Tab<const MCHAR *> LoadCategoryNames ( const MCHAR fileName)
pure virtual

return a list of all preset category names saved in a given preset file.

Parameters
fileNameThe file to query for saved preset categories
virtual BitArray SaveCategories ( RendererSpecifier  rendSpecifier)
pure virtual

return a list of all preset category ID's that are meaningful to the specified renderer.

Parameters
rendSpecifierWhich current renderer to query for meaningful categories
Returns
An array specifying the preset categories ID's that are applicable to the current renderer
virtual Tab<const MCHAR *> SaveCategoryNames ( RendererSpecifier  rendSpecifier)
pure virtual

return a list of all preset category names that are meaningful to the specified renderer.

Parameters
rendSpecifierWhich current renderer to query for meaningful categories
Returns
An array specifying the preset categories ID's that are applicable to the current renderer
virtual RenderPresetsContext* GetContext ( )
pure virtual

Retrieve the current RenderPresetContext.

Remarks
This is provided so that renderers can tailor their save and load methods to accomodate the saving and loading of any combination of render preset categories.

This method will return NULL unless a render preset is currently being loaded or saved. An example usage would be to call this inside a Load() method or post-load callback, and if not NULL, check for compatibility by looking at the version number and categories of the preset context.
Returns
the current RenderPresetContext if present, else NULL.