3ds Max C++ API Reference
ISimpleMaterialExt Class Referenceabstract

ISimpleMaterialExt extends ISimpleMaterial to support more textures. More...

#include <ISimpleMaterial.h>

+ Inheritance diagram for ISimpleMaterialExt:

Public Types

enum  TextureOperation { TextureOperationDisable , TextureOperationModulate , TextureOperationBlendTextureAlpha }
 Stage texture operation type. More...
 
- Public Types inherited from ISimpleMaterial
enum  FillMode { FillPoint , FillWireframe , FillSolid }
 This is the fill mode used in both SetFillMode and GetFillMode. More...
 
enum  MapUsage { UsageDiffuse = 0 , UsageOpacity , MaxUsage }
 This enum type tells the viewport rendering system the usage of each texture. More...
 
- Public Types inherited from BaseInterface
enum  LifetimeType { noRelease , immediateRelease , wantsRelease , serverControlled }
 

Public Member Functions

virtual unsigned int GetMaxTextureStageCount () const =0
 Returns the maximum number of texture stages that 3dsmax system supports. More...
 
virtual bool SetTextureStageCount (unsigned int numberStage)=0
 Set number of texture stages. More...
 
virtual unsigned int GetTextureStageCount () const =0
 Returns the number of texture stages. More...
 
virtual bool SetStageTexture (unsigned int stage, TexHandle *pTexture)=0
 Set stage texture with texture handle. More...
 
virtual bool SetTextureColorOperation (unsigned int stage, TextureOperation colorOp)=0
 Set stage texture color operation. More...
 
- Public Member Functions inherited from ISimpleMaterial
virtual ISimpleMaterialClone ()=0
 Clones the instance of ISimpleMaterial. More...
 
virtual void SetFillMode (ISimpleMaterial::FillMode mode)=0
 Specifies the fill mode of the material. More...
 
virtual ISimpleMaterial::FillMode GetFillMode () const =0
 Returns the fill mode that the material is using. More...
 
virtual void SetAmbientColor (const AColor &color)=0
 Specifies the ambient color as an RGBA value. More...
 
virtual const AColorGetAmbientColor () const =0
 Returns ambient color that the material is using. More...
 
virtual void SetDiffuseColor (const AColor &color)=0
 Specifies diffuse color as an RGBA value. More...
 
virtual const AColorGetDiffuseColor () const =0
 Returns diffuse color that the material is using. More...
 
virtual void SetSpecularColor (const AColor &color)=0
 Specifies the specular color as an RGBA value. More...
 
virtual const AColorGetSpecularColor () const =0
 Returns specular color that the material is using. More...
 
virtual void SetEmissiveColor (const AColor &color)=0
 Specifies the Emissive color as an RGBA value. More...
 
virtual const AColorGetEmissiveColor () const =0
 Returns Emissive color that the material is using. More...
 
virtual void SetSpecularPower (float power)=0
 Specifies the specular exponent of the material to be set. More...
 
virtual float GetSpecularPower ()=0
 Returns specular power that the material is using. More...
 
virtual void SetSpecularLevel (float level)=0
 Specifies the specular level. More...
 
virtual float GetSpecularLevel () const =0
 Returns specular level that the material is using. More...
 
virtual void SetSelfIllumColorOn (bool bOn)=0
 Specifies the self illumination mode. More...
 
virtual bool GetSelfIllumColorOn () const =0
 Returns self illumination mode that the material is using. More...
 
virtual bool SetTextureTransform (MapUsage usage, const Matrix3 &transform)=0
 Set texture transform matrix. More...
 
virtual Matrix3GetTextureTransform (MapUsage usage)=0
 Get texture transform matrix. More...
 
virtual bool SetTexture (TexHandle *pTexture, MapUsage usage)=0
 Set texture with texture handle. More...
 
virtual TexHandleGetTexture (MapUsage usage)=0
 Get texture handle. More...
 
virtual void ClearTextures ()=0
 Clears all texture used by this material. More...
 
virtual bool SetBorderColor (MapUsage usage, const AColor &color)=0
 Sets the border color as an RGBA value for the texture with the specified texture usage. More...
 
virtual const AColorGetBorderColor (MapUsage usage) const =0
 Returns the border color of the texture with the specified texture usage. More...
 
- Public Member Functions inherited from BaseInterface
virtual UtilExport ~BaseInterface ()
 Destructor. More...
 
UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
virtual UtilExport Interface_ID GetID ()
 
virtual LifetimeType LifetimeControl ()
 
virtual bool RegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual void UnRegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual BaseInterfaceAcquireInterface ()
 
virtual void ReleaseInterface ()
 
virtual void DeleteInterface ()
 
virtual BaseInterfaceCloneInterface (void *remapDir=NULL)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

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

Detailed Description

ISimpleMaterialExt extends ISimpleMaterial to support more textures.

To distinguish from a ISimpleMaterial texture, a texture here is called a 'stage texture'. It is like D3D SetTextureStageState. To access the property, use the following code

ISimpleMaterial *pISimpleMaterial = (ISimpleMaterial *)GetProperty(PROPID_SIMPLE_MATERIAL);
ISimpleMaterialExt* pSimpleMaterialExt = static_cast<ISimpleMaterialExt*>(pISimpleMaterial->GetInterface(ISIMPLE_MATERIAL_EXT_INTERFACE_ID));
#define PROPID_SIMPLE_MATERIAL
Definition: AnimPropertyID.h:22
#define ISIMPLE_MATERIAL_EXT_INTERFACE_ID
Interface ID of class ISimpleMaterialExt.
Definition: ISimpleMaterial.h:19

Member Enumeration Documentation

◆ TextureOperation

Stage texture operation type.

Enumerator
TextureOperationDisable 

Disables output from this texture stage.

TextureOperationModulate 

Multiply the components of the texure stage.

TextureOperationBlendTextureAlpha 

Linearly blend this texture stage, using the alpha from this stage's texture.

230  {
234  };
@ TextureOperationBlendTextureAlpha
Linearly blend this texture stage, using the alpha from this stage's texture.
Definition: ISimpleMaterial.h:233
@ TextureOperationModulate
Multiply the components of the texure stage.
Definition: ISimpleMaterial.h:232
@ TextureOperationDisable
Disables output from this texture stage.
Definition: ISimpleMaterial.h:231

Member Function Documentation

◆ GetMaxTextureStageCount()

virtual unsigned int GetMaxTextureStageCount ( ) const
pure virtual

Returns the maximum number of texture stages that 3dsmax system supports.

As of 3ds Max 2016, a maximum of 8 textures stages is supported.

Returns
maximum number.

◆ SetTextureStageCount()

virtual bool SetTextureStageCount ( unsigned int  numberStage)
pure virtual

Set number of texture stages.

See also
ITextureDisplay::SetupTextures()
Parameters
[in]numberStagenumber of stage.
Returns
True if successful

◆ GetTextureStageCount()

virtual unsigned int GetTextureStageCount ( ) const
pure virtual

Returns the number of texture stages.

Returns
the number of texture stages.

◆ SetStageTexture()

virtual bool SetStageTexture ( unsigned int  stage,
TexHandle pTexture 
)
pure virtual

Set stage texture with texture handle.

See also
ITextureDisplay::SetupTextures()
Parameters
[in]stageThe stage texture index.
[in]pTextureA texture handle. If pTexture is NULL it will clear the texture. This can give finer control than using ClearTextures()
Returns
True if successful

◆ SetTextureColorOperation()

virtual bool SetTextureColorOperation ( unsigned int  stage,
TextureOperation  colorOp 
)
pure virtual

Set stage texture color operation.

See also
ITextureDisplay::SetupTextures()
Parameters
[in]stageThe stage texture index.
[in]colorOpcolor operation.
Returns
True if successful