Public Member Functions

IMtlRender_Compatibility_MtlBase Class Reference

This reference page is linked to from the following overview topics: Mental Ray Classes, Translation of Texture Map and Materials.


Search for all occurrences

Detailed Description

See also:
Class IMtlRender_Compatibility_Renderer, Class ClassDesc2, Class Mtl, Class Texmap
Description:
This interface is used to determine whether a material/map flags itself as being compatible with a specific renderer plugin. If the material/map flags itself as being compatible with a renderer, then it is deemed compatible with that renderer regardless of what class IMtlRender_Compatibility_Renderer might say.
Implementation:
To be inheritted by a ClassDesc or ClassDesc2 of a Texmap or Mtl plugin. The child class needs to call Init(*this) in its constructor.
Default compatibility:
If neither the renderer nor the material/map implements the compatibility interface, they are considered compatible by default.
Material/map browser icon:
The interface also provides a way of defining an icon that appears in the material browser - GetCustomMtlBrowserIcon. This can be used to provide an Enable color. In mental ray enabled uses a yellow icon, the DirextX 9 Shader uses a pink icon. Developers can use this to highlight special materials or textures.

#include <IMtlRender_Compatibility.h>

Inheritance diagram for IMtlRender_Compatibility_MtlBase:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void  Init (ClassDesc &classDesc)
virtual bool  IsCompatibleWithRenderer (ClassDesc &rendererClassDesc)=0
virtual bool  GetCustomMtlBrowserIcon (HIMAGELIST &hImageList, int &inactiveIndex, int &activeIndex, int &disabledIndex)

Member Function Documentation

void Init ( ClassDesc classDesc ) [inline]
Remarks:
Initialization method. MUST be called from the constructor of the child class. i.e. "Init(*this);".
Parameters:
classDesc - Reference to sub-class instance
                                                                       {

    LoadDescriptor(IMTLRENDER_COMPATIBILITY_MTLBASE_INTERFACEID, _M("IMtlRender_Compability_MtlBase"), 0, &classDesc, 0, end);
}
virtual bool IsCompatibleWithRenderer ( ClassDesc rendererClassDesc ) [pure virtual]
Remarks:
Returns whether this material/map is compatible with the given renderer. (Use the class ID of the renderer to determine compatibility).
Parameters:
rendererClassDesc - Class descriptor of a Renderer plugin

Implemented in MSPluginDesc.

virtual bool GetCustomMtlBrowserIcon ( HIMAGELIST &  hImageList,
int &  inactiveIndex,
int &  activeIndex,
int &  disabledIndex 
) [inline, virtual]
Remarks:
Provides custom icons for the material/map browser. Returns true if custom icons are provided.

When using this method, the developer should keep a single instance of the imagelist used, and it is the developers responsibility to release the memory
Parameters:
hImagelist - The image list from which the icons are extracted. The images should have a mask.
inactiveIndex - Index (into image list) of icon to be displayed when the material/map has the "Show Maps in Viewport" flag turned OFF.
activeIndex - Index (into image list) of icon to be displayed when the material/map has the "Show Maps in Viewport" flag turned ON.
disabledIndex - Index (into image list) of icon to be displayed when the material/map is NOT COMPATIBLE with the current renderer.
Returns:
true if custom icons are provided

Reimplemented in MSPluginDesc.

    { 
        return false; 
    }

IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase
IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase IMtlRender_Compatibility_MtlBase