Class MtlBaseLib

3DS Max Plug-In SDK

Class MtlBaseLib

See Also: Class ReferenceTarget, Class MtlBaseList, Class MtlBase, Class Interface.

class MtlBaseLib : public ReferenceTarget, public MtlBaseList

Description:

This class is a library of MtlBase entries. To get a list of the currently loaded materials use:

 MtlBaseLib& Interface::GetMaterialLibrary().

When you load a material library, you can enumerate all the materials that it contains. MtlBaseLib is subclassed off of MtlBaseList which is a Tab<MtlHandle>, so for example, you can do the following to work with each material:

 for (int i=0; i<mlib.Count(); i++) { DoSomething(mlib[i]); }

For additional information on this class see the Advanced Topics sectoin Working with Materials and Textures. All methods of this class are implemented by the system.

Methods:

Prototype:

virtual void Remove(MtlBase *m);

Remarks:

Removes the specified MtlBase from the library.

Parameters:

MtlBase *m

The MtlBase to remove.

Prototype:

virtual void Add(MtlBase *m);

Remarks:

Adds the specified MtlBase to the library.

Parameters:

MtlBase *m

The MtlBase to add.

Prototype:

virtual void RemoveDuplicates();

Remarks:

Removes all duplicate MtlBases from the library.

Prototype:

void DeleteAll();

Remarks:

Removes all MtlBases from the library and deletes all references.

Prototype:

~MtlBaseLib();

Remarks:

Destructor. All references are deleted.