3ds Max C++ API Reference
|
Facilitates translation of material and texture map parameter values to their shaders representation. More...
#include <IParameterTranslator.h>
Public Types | |
enum | ShaderParameterType { ShaderParameterTypeUnknown = 0 , ShaderParameterTypeFloat , ShaderParameterTypeInt , ShaderParameterTypeBool , ShaderParameterTypeColor , ShaderParameterTypePoint2 , ShaderParameterTypePoint3 , ShaderParameterTypePoint4 , ShaderParameterTypeTexture , ShaderParameterTypeMatrix4 } |
Shader parameter types. More... | |
enum | SubMtlBaseType { SubMaterial , SubTexmap } |
The type of plug-in's "sub" slot. More... | |
![]() | |
enum | LifetimeType { noRelease , immediateRelease , wantsRelease , serverControlled } |
Public Member Functions | |
virtual Interface_ID | GetID () |
Retrieves the interface id of IParameterTranslator. More... | |
virtual bool | GetParameterValue (const TimeValue t, const MCHAR *shaderParamName, void *value, ShaderParameterType type)=0 |
Retrieves the plug-in's parameter value that corresponds to a given shader parameter. More... | |
virtual bool | GetShaderInputParameterName (SubMtlBaseType type, int subMtlBaseIndex, MSTR &shaderInputParamName)=0 |
Retrieves the shader input parameter name for a given "sub" slot of the plug-in. More... | |
virtual bool | OnPreParameterTranslate ()=0 |
One time setup before any parameter is translated. More... | |
![]() | |
virtual UtilExport | ~BaseInterface () |
Destructor. More... | |
UtilExport BaseInterface * | GetInterface (Interface_ID id) |
virtual LifetimeType | LifetimeControl () |
virtual bool | RegisterNotifyCallback (InterfaceNotifyCallback *incb) |
virtual void | UnRegisterNotifyCallback (InterfaceNotifyCallback *incb) |
virtual BaseInterface * | AcquireInterface () |
virtual void | ReleaseInterface () |
virtual void | DeleteInterface () |
virtual BaseInterface * | CloneInterface (void *remapDir=NULL) |
![]() | |
virtual UtilExport | ~InterfaceServer () |
Destructor. More... | |
template<class InterfaceType > | |
InterfaceType * | GetTypedInterface () |
Additional Inherited Members | |
![]() | |
static UtilExport void * | operator new (size_t size) |
Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator 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 void * | operator 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 void * | operator 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 void * | operator 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 void * | operator 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 void * | operator 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 void * | operator 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 void * | operator 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 void * | operator 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 void * | operator new[] (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate arrays of objects. More... | |
static UtilExport void * | operator 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 void * | operator 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 void * | operator 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 void * | operator 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 void * | aligned_malloc (size_t size, size_t alignment) |
Allocates memory on a specified alignment boundary. More... | |
static UtilExport void * | aligned_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... | |
Facilitates translation of material and texture map parameter values to their shaders representation.
Materials and texture maps can use programmable shaders to describe their appearance when displayed in the Nitrous viewport and rendered with Quicksilver. Programmable shaders allow for a more realistic and complex visual appearance than ISimpleMaterial does. Note that 3ds Max 2012 only supports MetaSL shaders. See IShaderManager for more details.
The Nitrous graphics system handles automatic translation of Paramblock2 based material and texture map parameters given that their names and types match those of the shader. IParameterTranslator allows plug-ins to control this translation process. Nitrous queries the plug-in for the IParameterTranslator interface by passing IPARAMETER_TRANSLATOR_INTERFACE_ID to its overwrite of Animatable::GetInterface(Interface_ID), and uses it instead of its own automated translation. Nitrous automatically detects when a plug-in's parameters, reference structure or animatable structure changes, and will call the methods on this interface to re-translate the plug-in's parameters to the shader.
The following code snippet illustrates how a material plug-in may implement IParameterTranslator:
enum ShaderParameterType |
Shader parameter types.
Enumerator | |
---|---|
ShaderParameterTypeUnknown | unknown parameter type |
ShaderParameterTypeFloat | float type |
ShaderParameterTypeInt | int type |
ShaderParameterTypeBool | BOOL type. |
ShaderParameterTypeColor | AColor type. |
ShaderParameterTypePoint2 | Point2 type. |
ShaderParameterTypePoint3 | Point3 type. |
ShaderParameterTypePoint4 | Point4 type. |
ShaderParameterTypeTexture | MSTR type. |
ShaderParameterTypeMatrix4 | matrix44 type |
enum SubMtlBaseType |
|
inlinevirtual |
Retrieves the interface id of IParameterTranslator.
Reimplemented from BaseInterface.
|
pure virtual |
Retrieves the plug-in's parameter value that corresponds to a given shader parameter.
[in] | t | The time at which to retrieve the plug-in's parameter value |
[in] | shaderParamName | The name of the shader parameter. The name is not case sensitive. |
[out] | value | Pointer to a data structure that will store the plug-in's parameter value. This parameter will need to be cast to one of the supported types - see ShaderParameterType |
[in] | type | The type of the shader parameter |
|
pure virtual |
Retrieves the shader input parameter name for a given "sub" slot of the plug-in.
The plug-in need to "compute" the name of the input shader parameter that corresponds to a given "sub" slot identified by its slot index and type. Nitrous will connect the shader corresponding to material or texture map at that "sub" slot with the shader input parameter that has the name this method generates.
[in] | type | The type of plug-in's "sub" slot |
[in] | subMtlBaseIndex | The index of the "sub" slot within the plug-ins list of slots |
[out] | shaderInputParamName | The shader input parameter name |
|
pure virtual |
One time setup before any parameter is translated.
Called once before the parameter list is parsed. This could be used to make sure all parameters are valid before being translated.