Public Types | Public Member Functions

IRenderPresetsManager Class Reference

Search for all occurrences

Detailed 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();

#include <iRenderPresets.h>

Inheritance diagram for IRenderPresetsManager:
Inheritance graph
[legend]

List of all members.

Public Types

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

Public Member Functions

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

Member Enumeration Documentation


Constructor & Destructor Documentation

virtual ~IRenderPresetsManager ( ) [inline, virtual]

Destructor.

{;}

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:
rendSpecifier Which 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:
rendSpecifier Which renderer to save the presets of
fileName The 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:
rendSpecifier Which renderer to save the presets of
fileName The file to save the user-selected presets to.
saveCategories A 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:
rendSpecifier Which 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:
rendSpecifier Which renderer to load the presets for
fileName A 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:
rendSpecifier Which renderer to load the presets for
fileName A path to file to load the render presets from
loadCategories The preset categories to for the specified renderer
nodeRefAction One 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:
rendSpecifier The category to check compatability for
fileName The saved render preset file
Returns:
TRUE if the renderer currently assigned to rendSpecifier can load the presets in fileName
virtual MCHAR* MapIndexToCategory ( const MCHAR *  fileName,
int  catIndex 
) [pure virtual]

Retrieve a render presets name based on its ID.

Parameters:
fileName The file containing the preset we are looking for the name to
catIndex The 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:
fileName The file containing the preset we are looking for the ID for
category The name of the category saved in fileName to retrieve the ID of
Returns:
the ID of the specified render preset
virtual MCHAR* MapIndexToCategory ( RendererSpecifier  rendSpecifier,
int  catIndex 
) [pure virtual]

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

Parameters:
rendSpecifier Which current renderer to query for the preset category name.
catIndex The 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:
rendSpecifier Which current renderer to query for the preset category ID.
catIndex The 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:
fileName The file to query for saved preset categories
virtual Tab<MCHAR *> LoadCategoryNames ( const MCHAR *  fileName ) [pure virtual]

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

Parameters:
fileName The 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:
rendSpecifier Which 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<MCHAR *> SaveCategoryNames ( RendererSpecifier  rendSpecifier ) [pure virtual]

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

Parameters:
rendSpecifier Which 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.

IRenderPresetsManager IRenderPresetsManager IRenderPresetsManager IRenderPresetsManager IRenderPresetsManager IRenderPresetsManager IRenderPresetsManager IRenderPresetsManager IRenderPresetsManager IRenderPresetsManager
IRenderPresetsManager IRenderPresetsManager IRenderPresetsManager IRenderPresetsManager IRenderPresetsManager IRenderPresetsManager IRenderPresetsManager IRenderPresetsManager IRenderPresetsManager IRenderPresetsManager