Class IFaceDataMgr

3DS Max Plug-In SDK

Class IFaceDataMgr

See Also: Class BaseInterface, Class IDataChannel, Class IFaceDataChannel

class IFaceDataMgr : public BaseInterface

Description:

This class is available in release 4.0 and later only.

This class represents an Interface for managing face-data channels. Objects that wish to have face-data channels should implement this interface. If this interface needs to be changed, a new one should be derived from it and changed (IFaceDataMgr2) and ensuring that objects support face-data implementations of both old and new interfaces.

A "naive" extension of Mesh and MNMesh with a GetInterface method are available but there's no support for interface lifetime management. The Mesh and MNMesh have full control over the lifetime of the face-data manager and as such, clients should not cache an IFaceDataMgr interface aquired from Mesh or MNMesh.

Please note that only Meshes supports the IFaceDataMgr interface. The MNMesh (and thus polygons) does not support it. As a consequence, if you write a modifier that applies face data to a meshes, and then the pipeline transforms this mesh into a poly or patch, the face data is lost at the top of the stack.

Methods:

public:

Geometry pipeline (stack) methods

Modifiers and procedural objects should call these methods to add, remove, or retrieve a face-data channel on an object (mesh, patch, poly).

Prototype:

virtual ULONG NumFaceDataChans() const = 0;;

Remarks:

This method returns the number of face-data channels.

Prototype:

virtual IFaceDataChannel* GetFaceDataChan(const Class_ID& ID) const = 0;

Remarks:

This method returns a pointer to the face-data channel.

Parameters:

const Class_ID& ID

The class ID of the channel you wish to retrieve.

Prototype:

virtual BOOL AddFaceDataChan(IFaceDataChannel* pChan) = 0;

Remarks:

This method adds a face-data channel to the object.

Parameters:

IFaceDataChannel* pChan

A pointer to the face-data channel.

Return Value:

TRUE if successful, otherwise FALSE.

Prototype:

virtual BOOL RemoveFaceDataChan(const Class_ID& ID) = 0;

Remarks:

This method removes a face-data channel from the object.

Parameters:

const Class_ID& ID

The class ID of the channel you wish to remove.

Return Value:

TRUE if successful, otherwise FALSE.

Geometry pipeline (stack) methods

The system (3ds max) should call these methods to manage the face-data channels when the object flows up the stack

Prototype:

virtual BOOL AppendFaceDataChan(const IFaceDataChannel* pChan) = 0;

Remarks:

This method appends a face-data channel to the object.

Parameters:

const IFaceDataChannel* pChan

The face-data channel to append.

Return Value:

TRUE if successful, otherwise FALSE.

Prototype:

virtual BOOL CopyFaceDataChans(const IFaceDataMgr* pFrom) = 0;

Remarks:

This method adds or appends face-data channels from the from object, to this object If the channel already exists on this object, it's appended otherwise it gets added.

Parameters:

const IFaceDataMgr* pFrom

The face-data channel to copy from.

Return Value:

TRUE if successful, otherwise FALSE.

Prototype:

virtual void RemoveAllFaceDataChans() = 0;

Remarks:

This method removes all face-data channels from this object.

Prototype:

virtual BOOL EnumFaceDataChans(IFaceDataChannelsEnumCallBack& cb, void* pContext) const = 0;

Remarks:

This method provides a mechanism for executing an operation for all face-data-channels on this object: For all face-data-channels calls IFaceDataEnumCallBack::proc() with a pointer to that face-data- channel and a context data

Parameters:

IFaceDataChannelsEnumCallBack& cb

A pointer to the face-data channel enumerator callback.

void* pContext

A pointer to the context data.

Return Value:

FALSE if the callback returns FALSE for any of the face-data channels.

Prototype:

virtual IOResult Save(ISave* isave) = 0;

Remarks:

Saves the face-data to the max file.

Return Value:

See Also: List of IO Results.

Prototype:

virtual IOResult Load(ILoad* iload) = 0;

Remarks:

Loads the face-data from the max file.

Return Value:

See Also: List of IO Results.

Prototype:

Interface_ID GetID();

Remarks:

This method returns the interface ID of the object.

Default Implementation:

{ return FACEDATAMGR_INTERFACE; }