Class ISubMtlAPI

3DS Max Plug-In SDK

Class ISubMtlAPI

See Also: Working with Materials.

Description:

This class is available in release 2.5 and later only.

In 3ds max 2.5 this is only supported for objects flowing down the geometry pipeline.

This class is used if you wish to support the direct assignment of sub materials to selected faces. For a reference implementation of this class, please refer to the code in \MAXSDK\SAMPLES\MESH\EDITABLEMESH\TRIOBJED.CPP.

Methods:

public:

Prototype:

virtual MtlID GetNextAvailMtlID()=0;

Remarks:

This method returns a material ID that is currently not used by the object. If the current face selection share one single MtlDI that is not used by any other faces, you should use it.

Prototype:

virtual BOOL HasFaceSelection()=0;

Remarks:

This method indicates if you are active in the modifier panel and have an active face selection. Return TRUE if so, otherwise FALSE.

Prototype:

virtual void SetSelFaceMtlID(MtlID id, BOOL bResetUnsel = FALSE)=0;

Remarks:

This method sets the selected faces to the specified material ID..

Parameters:

MtlID id

The material id to set for the selected faces.

BOOL bResetUnsel = FALSE

If TRUE, then you should set the remaining unselected face material IDs to 0.

Prototype:

virtual int GetSelFaceUniqueMtlID()=0;

Remarks:

This method returns the material ID of the selected face(s). If multiple faces are selected they should all have the same MtlID -- otherwise you should return -1. If faces other than the selected share the same material ID, then return -1.

Prototype:

virtual int GetSelFaceAnyMtlID()=0;

Remarks:

This method returns the material ID of the selected face(s). If multiple faces are selected they should all have the same MtlID, otherwise return -1.

Prototype:

virtual int GetMaxMtlID()=0;

Remarks:

This method returns the highest MtlID on the object.