3ds Max C++ API Reference
IMtlRender_Compatibility.h File Reference
#include "ifnpub.h"
#include "baseinterface.h"
#include <CommCtrl.h>
#include "plugapi.h"

Classes

class  IMtlRender_Compatibility_MtlBase
 
class  IMtlRender_Compatibility_Renderer
 

Macros

#define IMTLRENDER_COMPATIBILITY_MTLBASE_INTERFACEID   Interface_ID(0x5537445b, 0x70a97e02)
 
#define IMTLRENDER_COMPATIBILITY_RENDERER_INTERFACEID   Interface_ID(0x25d24114, 0xdbe505f)
 

Functions

IMtlRender_Compatibility_MtlBaseGet_IMtlRender_Compability_MtlBase (ClassDesc &mtlBaseClassDesc)
 
IMtlRender_Compatibility_RendererGet_IMtlRender_Compatibility_Renderer (ClassDesc &rendererClassDesc)
 
bool AreMtlAndRendererCompatible (ClassDesc &mtlBaseClassDesc, ClassDesc &rendererClassDesc)
 Returns whether the given Mtl/Texmap plugin is compatible with the given Renderer plugin. More...
 

Macro Definition Documentation

◆ IMTLRENDER_COMPATIBILITY_MTLBASE_INTERFACEID

#define IMTLRENDER_COMPATIBILITY_MTLBASE_INTERFACEID   Interface_ID(0x5537445b, 0x70a97e02)

◆ IMTLRENDER_COMPATIBILITY_RENDERER_INTERFACEID

#define IMTLRENDER_COMPATIBILITY_RENDERER_INTERFACEID   Interface_ID(0x25d24114, 0xdbe505f)

Function Documentation

◆ Get_IMtlRender_Compability_MtlBase()

IMtlRender_Compatibility_MtlBase* Get_IMtlRender_Compability_MtlBase ( ClassDesc mtlBaseClassDesc)
inline
95  {
96 
98 }
#define IMTLRENDER_COMPATIBILITY_MTLBASE_INTERFACEID
Definition: IMtlRender_Compatibility.h:28
virtual CoreExport FPInterface * GetInterface(Interface_ID id)
Returns a pointer to the function publishing interface whose ID is specified.
Definition: IMtlRender_Compatibility.h:58

◆ Get_IMtlRender_Compatibility_Renderer()

IMtlRender_Compatibility_Renderer* Get_IMtlRender_Compatibility_Renderer ( ClassDesc rendererClassDesc)
inline
135  {
136 
138 }
#define IMTLRENDER_COMPATIBILITY_RENDERER_INTERFACEID
Definition: IMtlRender_Compatibility.h:29
Definition: IMtlRender_Compatibility.h:119

◆ AreMtlAndRendererCompatible()

bool AreMtlAndRendererCompatible ( ClassDesc mtlBaseClassDesc,
ClassDesc rendererClassDesc 
)
inline

Returns whether the given Mtl/Texmap plugin is compatible with the given Renderer plugin.

Always use this function to determine compatibility.

146  {
147 
148  IMtlRender_Compatibility_MtlBase* mtlBaseCompatibility = Get_IMtlRender_Compability_MtlBase(mtlBaseClassDesc);
149  IMtlRender_Compatibility_Renderer* rendererCompatibility = Get_IMtlRender_Compatibility_Renderer(rendererClassDesc);
150 
151  if((mtlBaseCompatibility == NULL) && (rendererCompatibility == NULL)) {
152  // No compatibility info: compatible by default
153  return true;
154  }
155  else if((mtlBaseCompatibility != NULL) && mtlBaseCompatibility->IsCompatibleWithRenderer(rendererClassDesc)) {
156  // Material says it's compatible with the renderer: compatible
157  return true;
158  }
159  else if((rendererCompatibility != NULL) && rendererCompatibility->IsCompatibleWithMtlBase(mtlBaseClassDesc)) {
160  // Renderer says it's compatible with the material: compatible
161  return true;
162  }
163  else {
164  // Neither material nor renderer says it's compatible: incompatible
165  return false;
166  }
167 }
IMtlRender_Compatibility_MtlBase * Get_IMtlRender_Compability_MtlBase(ClassDesc &mtlBaseClassDesc)
Definition: IMtlRender_Compatibility.h:95
IMtlRender_Compatibility_Renderer * Get_IMtlRender_Compatibility_Renderer(ClassDesc &rendererClassDesc)
Definition: IMtlRender_Compatibility.h:135
#define NULL
Definition: autoptr.h:18
virtual bool IsCompatibleWithRenderer(ClassDesc &rendererClassDesc)=0
virtual bool IsCompatibleWithMtlBase(ClassDesc &mtlBaseClassDesc)=0