3ds Max C++ API Reference
ISubMap Class Referenceabstract

#include <ISubMap.h>

+ Inheritance diagram for ISubMap:

Public Member Functions

virtual ~ISubMap ()
 
virtual int NumSubTexmaps ()
 
virtual TexmapGetSubTexmap (int i)
 
virtual int MapSlotType (int i)=0
 
virtual void SetSubTexmap (int i, Texmap *m)
 
virtual int SubTexmapOn (int i)
 
virtual MSTR GetSubTexmapSlotName (int i) MAX_SEALED
 
virtual CoreExport MSTR GetSubTexmapSlotName (int i, bool localized)
 
CoreExport MSTR GetSubTexmapTVName (int i, bool localized=true)
 
virtual BOOL SetDlgThing (ParamDlg *dlg)
 
CoreExport void CopySubTexmap (HWND hwnd, int ifrom, int ito)
 
virtual ReferenceTargetGetRefTarget ()=0
 

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

See also
Class MtlBase, Class Texmap, Class ParamDlg, Class ReferenceTarget.

Description:
The methods of this class provide access to the sub-textures of a MtlBase. These properties include the number of sub-maps, the slot type, on / off state, etc.

The MtlBase class sub-classes from this class. If a developer is creating a plug-in derived from MtlBase (for instance a Material or Texture) then implementations of these methods are required. Developers may call these methods on an existing MtlBase sub-class.

Constructor & Destructor Documentation

◆ ~ISubMap()

virtual ~ISubMap ( )
inlinevirtual
Remarks
Destructor.
46 {;}

Member Function Documentation

◆ NumSubTexmaps()

virtual int NumSubTexmaps ( )
inlinevirtual
Remarks
Returns the number of sub-textures managed by this material or texture.
Default Implementation:
{ return 0; }

Reimplemented in MSMtlXtnd, MSPluginMtl, MSTexmapXtnd, MSPluginTexmap, and MSCustAttrib.

51 { return 0; }

◆ GetSubTexmap()

virtual Texmap* GetSubTexmap ( int  i)
inlinevirtual
Remarks
Returns a pointer to the 'i-th' sub-texmap managed by the material or texture.

Note: For the 3ds Max Standard material, the sub-texmap indexes used with this method are listed in Texture Map Indices.
Parameters:
int i

Specifies the texmap to return.
Default Implementation:
{ return NULL; }

Reimplemented in MSMtlXtnd, MSPluginMtl, MSTexmapXtnd, MSPluginTexmap, and MSCustAttrib.

61 { return NULL; }
#define NULL
Definition: autoptr.h:18

◆ MapSlotType()

virtual int MapSlotType ( int  i)
pure virtual
Remarks
In the Coordinates rollup in the user interface for a texture map are two options. These options are Texture or Environment. The slot type is one of these two options, texture coordinates or environment coordinates. There are a variety of texture coordinate types. There are the type assigned to the object and the environment type (Spherical, Cylindrical, Shrink-wrap, Screen). This method is used to determine the type required by the particular sub-texture. This is either texture coordinates (MAPSLOT_TEXTURE) or environment coordinates (MAPSLOT_ENVIRON).
Parameters:
int i

The index of the sub-texture whose slot type to return.
Returns
See Map Slot Types.
Default Implementation:
{ return MAPSLOT_TEXTURE; }

Implemented in MSCustAttrib, Texmap, and MtlBase.

◆ SetSubTexmap()

virtual void SetSubTexmap ( int  i,
Texmap m 
)
inlinevirtual
Remarks
Stores the 'i-th' sub-texmap managed by the material or texture.

Note: For the 3ds Max Standard material, the sub-texmap indexes used with this method are listed in Texture Map Indices.
Parameters:
int i

The index of the storage for the texmap.

Texmap *m

The texmap to store.
Default Implementation:
{}

Reimplemented in MSMtlXtnd, MSPluginMtl, MSTexmapXtnd, MSPluginTexmap, and MSCustAttrib.

88 { }

◆ SubTexmapOn()

virtual int SubTexmapOn ( int  i)
inlinevirtual
Remarks
Returns nonzero if the specified sub-texmap is on; otherwise zero. Some materials may have user interface controls to toggle the sub-maps on and off. The Standard material has such controls for example.
Parameters:
int i

The index of the sub-texmap to check.
Default Implementation:
{ return 1; }
99 { return 1; }

◆ GetSubTexmapSlotName() [1/2]

virtual MSTR GetSubTexmapSlotName ( int  i)
inlinevirtual
Note
This method has been deprecated in terms of implementation as of 3ds Max 2022. Plugin developers should implement GetSubTexmapSlotName(int i, bool localized) instead. This method can no longer be overriden and calls to it are now forwarded to the function that replaced it with a "bool localized" value of true. This is done so that plugin developers who do not localize their plugins don't have to update all the places where they call this method. Plugin developers who do localize their plugins should analyze the places where they call this method to decide what value to pass it for the "bool localized" parameter.
See also
ISubMap::GetSubTexmapSlotName(int i, bool localized)
109  {
110  return GetSubTexmapSlotName(i, true);
111  };
virtual MSTR GetSubTexmapSlotName(int i) MAX_SEALED
Definition: ISubMap.h:108

◆ GetSubTexmapSlotName() [2/2]

virtual CoreExport MSTR GetSubTexmapSlotName ( int  i,
bool  localized 
)
virtual
Remarks
This method returns the slot name of the 'i-th' sub-texmap. This name appears in the materials editor dialog. For instance, if you are in a material and then you go down into a map, this is the name that appears just below the 'Get Material' icon. For example, in the Standard material when you choose one of the maps, the map name appears to let you know which slot you are working on. For the Standard material, this may be "Ambient", "Diffuse", "Specular", etc.
Parameters:
int i

Specifies the slot whose name is returned. bool localized

If true, then the slot name returned should be localized in the language 3ds Max is currently using. Otherwise it should be the slot name in English. If a plugin does not provide localized string resources, it can disregard this parameter and always return the slot name in English.
Default Implementation:
The default implementation returns an empty ("") string.

Reimplemented in MSMtlXtnd, MSPluginMtl, MSTexmapXtnd, MSPluginTexmap, and MSCustAttrib.

◆ GetSubTexmapTVName()

CoreExport MSTR GetSubTexmapTVName ( int  i,
bool  localized = true 
)
Remarks
Returns the name to appear in Track View of the 'i-th' sub-texmap.
Parameters:
int i

Specifies the sub-texmap whose track view name is returned. bool localized

If true, then the sub-texmap TV name returned should be localized in the language 3ds Max is currently using. Otherwise it should be the sub-texmap TV name in English. If a plugin does not provide localized string resources, it can disregard this parameter and always return the sub-texmap TV name in English.

◆ SetDlgThing()

virtual BOOL SetDlgThing ( ParamDlg dlg)
inlinevirtual
Remarks
This method is called by the ParamMap2 AUTO_UI system if the material/texmap is letting the system build an AutoMParamDlg for it. This method is called on a material/texmap coming into an existing set of ParamDlgs, once for each secondary ParamDlg and it should set the appropriate 'thing' into the given dlg (the 'thing' being, for example, a Texout* or UVGen*). Return FALSE if dlg is unrecognized.

Note: See the discussion above in CreateParamDlg() for additional details on this method.
Parameters:
ParamDlg* dlg

Points to the ParamDlg to check. See Class ParamDlg.
Returns
TRUE if the dlg passed is recognized; FALSE if unrecognized.
Default Implementation:
{ return FALSE; }
Sample Code:
BOOL Gradient::SetDlgThing(ParamDlg* dlg)
{
if (dlg == uvGenDlg)
uvGenDlg->SetThing(uvGen);
else if (dlg == texoutDlg)
texoutDlg->SetThing(texout);
else
return FALSE;
return TRUE;
}
Definition: ParamDlg.h:26
174 { return FALSE; }

◆ CopySubTexmap()

CoreExport void CopySubTexmap ( HWND  hwnd,
int  ifrom,
int  ito 
)
Remarks
Implemented by the System.

This method is used to handle the drag-and-drop of texmaps. A developer implements the logic to handle the drag and drop. Once they have the information about what slot was dropped on what other slot, this method may be called to handle the copying. This is used by the 3ds Max Standard material.
Parameters:
HWND hwnd

The rollup page window handle.

int ifrom

The source texmap.

int ito

The destination texmap.

◆ GetRefTarget()

virtual ReferenceTarget* GetRefTarget ( )
pure virtual
Remarks
Implemented by the System.

The implementation of this method is provided by MtlBase. It returns its this pointer.

Implemented in MSMtlXtnd, MSPluginMtl, MSTexmapXtnd, MSPluginTexmap, MSCustAttrib, and MtlBase.