Core Interface Management

Module description

A "core" interface is usually a singleton manager object that can be used by client code without explicitly creating an instance of a plug-in.

"Core" interfaces are usually exposed to Maxscript and are derived from class FPInterfaceDesc or class FPStaticInterface and use the FP_CORE flag.

Functions

CoreExport void RegisterCOREInterface (FPInterface *fpi)
 Registers a "core" interface with 3ds Max. More...
 
CoreExport FPInterfaceGetCOREInterface (Interface_ID id)
 Retrieves a "core" interface based on a unique id. More...
 
CoreExport int NumCOREInterfaces ()
 Returns the count of "core" interfaces registered with 3ds Max. More...
 
CoreExport FPInterfaceGetCOREInterfaceAt (int i)
 Retrieves a "core" interface based on an index value Note that the order of "core" interfaces is not guaranteed. More...
 
CoreExport void UnregisterCOREInterface (FPInterface *fpi)
 Unregisters a "core" interface previously registered with 3ds Max. More...
 

Function Documentation

CoreExport void RegisterCOREInterface ( FPInterface fpi)

Registers a "core" interface with 3ds Max.

Plug-ins can register their own "core" interfaces identified by a unique Interface_ID value. In order to register a "core" interface with 3ds Max, it's enough to declare an instance of a FPInterfaceDesc, i.e. plug-ins do not need to call RegisterCOREInterface(FPInterface* fpi). For more details see class FPInterfaceDesc.

Parameters
fpi- pointer to the "core" interface object or its descriptor
CoreExport FPInterface* GetCOREInterface ( Interface_ID  id)

Retrieves a "core" interface based on a unique id.

Parameters
id- Unique interface id
Returns
- Pointer to the corresponding "core" interface
CoreExport int NumCOREInterfaces ( )

Returns the count of "core" interfaces registered with 3ds Max.

CoreExport FPInterface* GetCOREInterfaceAt ( int  i)

Retrieves a "core" interface based on an index value Note that the order of "core" interfaces is not guaranteed.

This means that the index of a "core" interface may not be given by NumCOREInterfaces()-1 right after the interface has been registered.

Parameters
i- index of the interface to retrieve. This is a zero based index.
Returns
- Pointer to the corresponding "core" interface
CoreExport void UnregisterCOREInterface ( FPInterface fpi)

Unregisters a "core" interface previously registered with 3ds Max.

Note that "Core" interfaces derived from class FPInterface or a subclass of it are automatically unregistered when the C++ object that implements them is destroyed.

Parameters
fpi- Pointer to the interface to unregister