FBX C++ API Reference
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FbxPlugin Class Referenceabstract

#include <fbxplugin.h>

Class Description

The base class to inherit from when creating new plug-ins for the FBX SDK.

Plug-ins for the FBX SDK are extremely flexible allowing a wide-range of possibilities. For example, one can write his own plug-in to add new readers/writers to the current list of supported I/O formats, or add new dynamic classes to instantiate custom objects that can later be stored in FBX files. We also use the same interface for plug-ins written using the FBX Extension SDK, which allow additional callbacks for other various Autodesk products enabling greater interoperability with multiple various SDKs.

Here is typical implementation of an FBX SDK plug-in that doesn't do anything else than just registering itself:

class MyPlugin : public FbxPlugin
{
FBXSDK_PLUGIN_DECLARE(MyPlugin); //This macro is mandatory for any plug-in definition
protected:
explicit MyPlugin(const FbxPluginDef& pDefinition, FbxModule pModuleHandle) : FbxPlugin(pDefinition, pModuleHandle)
{
}
//Abstract functions that *must* be implemented
virtual bool SpecificInitialize()
{
//For example, here we could register as many new I/O readers/writers as we would like, or classes, etc.
return true;
}
virtual bool SpecificTerminate()
{
//Here we would have to unregister whatever we registered to the FBX SDK
return true;
}
};
FBXSDK_PLUGIN_IMPLEMENT(MyPlugin); //This macro is mandatory for any plug-in implementation
//Standard C export needed for any new FBX SDK plug-in
extern "C"
{
static MyPlugin* sMyPluginInstance = NULL; //The module is owner of the plug-in
//This function will be called when an application will request the plug-in
#ifdef FBXSDK_ENV_WIN
__declspec(dllexport) void FBXPluginRegistration(FbxPluginContainer& pContainer, FbxModule pModuleHandle)
#else
void FBXPluginRegistration(FbxPluginContainer& pContainer, FbxModule pModuleHandle)
#endif
{
if( sPlugin == NULL )
{
//Create the plug-in definition which contains the information about the plug-in
FbxPluginDef sPluginDef;
sPluginDef.mName = "My Plugin";
sPluginDef.mVersion = "1.0";
//Create an instance of the plug-in
sMyPluginInstance = MyPlugin::Create(sPluginDef, pLibHandle);
//Register the plug-in with the FBX SDK
pContainer.Register(*sPlugin);
}
}
}
See also
FbxPluginDef, FbxPluginData

Definition at line 148 of file fbxplugin.h.

+ Inheritance diagram for FbxPlugin:

Public Member Functions

virtual bool SpecificInitialize ()=0
 Abstract function called once at the end of the plug-in construction. More...
 
virtual bool SpecificTerminate ()=0
 Abstract function called once at the beginning of the plug-in destruction. More...
 
virtual void WriteBegin (FbxScene &pScene)
 Virtual function called once when the FBX SDK is about to write an FBX file. More...
 
virtual void WriteParameters (FbxObject &pParams)
 Virtual function called once when the FBX SDK is about to write plug-in's parameters. More...
 
virtual void WriteEnd (FbxScene &pScene)
 Virtual function called once after the FBX SDK wrote an FBX file. More...
 
virtual void ReadBegin (FbxScene &pScene)
 Virtual function called once when the FBX SDK is about to read an FBX file. More...
 
virtual void ReadParameters (FbxObject &pParams)
 Virtual function called once after the FBX SDK reads the plug-in's parameters. More...
 
virtual void ReadEnd (FbxScene &pScene)
 Virtual function called once after the FBX SDK read an FBX file. More...
 
const FbxPluginDefGetDefinition () const
 Accessor to the plug-in definition structure that contains basic information on the plug-in like its name or version. More...
 
FbxModule GetModuleHdl ()
 Retrieve the module address pointer for this plug-in. More...
 
- Public Member Functions inherited from FbxListener
 ~FbxListener ()
 Destructor. More...
 
 FbxListener ()
 Constructor. More...
 
template<typename EventType , typename ListenerType >
FbxEventHandlerBind (FbxEmitter &pEmitter, void(ListenerType::*pFunc)(const EventType *))
 Bind current listener and the specified emitter together via an automatically created event handler. More...
 
template<typename EventType , typename ListenerType >
FbxEventHandlerBind (FbxEmitter &pEmitter, void(ListenerType::*pFunc)(const EventType *) const)
 Bind current listener and the specified emitter together via an automatically created event handler. More...
 
template<typename EventType >
FbxEventHandlerBind (FbxEmitter &pEmitter, void(*pFunc)(const EventType *, FbxListener *))
 Bind current listener and the specified emitter together via an automatically created event handler. More...
 
void Unbind (const FbxEventHandler *aBindId)
 Unbind an event handler. More...
 

Protected Member Functions

 FbxPlugin (const FbxPluginDef &pDefinition, FbxModule pModuleHandle)
 Use the Create() and Destroy() methods declared and implemented in the FBXSDK_PLUGIN_DECLARE and FBXSDK_PLUGIN_IMPLEMENT macros to construct and destroy FbxPlugin objects. More...
 
FbxPluginDataGetData ()
 Accessor to the plug-in private data. More...
 
const FbxPluginDataGetData () const
 Const accessor to the plug-in private data. More...
 

Constructor & Destructor Documentation

◆ FbxPlugin()

FbxPlugin ( const FbxPluginDef pDefinition,
FbxModule  pModuleHandle 
)
explicitprotected

Use the Create() and Destroy() methods declared and implemented in the FBXSDK_PLUGIN_DECLARE and FBXSDK_PLUGIN_IMPLEMENT macros to construct and destroy FbxPlugin objects.

Parameters
pDefinitionThe definition associated with this plug-in. Each plug-in must have its own definition to differentiate it with other plug-ins.
pModuleHandleA pointer to the plug-in module address.

Member Function Documentation

◆ SpecificInitialize()

virtual bool SpecificInitialize ( )
pure virtual

Abstract function called once at the end of the plug-in construction.

At that moment, plug-in data have been properly initialized. This function must be implemented by anyone who writes a new plug-in for the FBX SDK.

◆ SpecificTerminate()

virtual bool SpecificTerminate ( )
pure virtual

Abstract function called once at the beginning of the plug-in destruction.

At that moment, plug-in data is fully available. This function must be implemented by anyone who writes a new plug-in for the FBX SDK.

◆ WriteBegin()

virtual void WriteBegin ( FbxScene pScene)
virtual

Virtual function called once when the FBX SDK is about to write an FBX file.

Users can re-implement it in their plug-in if they need to perform tasks at that moment. The scene provided in parameter can be altered. If not re-implemented, this function does nothing.

Parameters
pSceneThe scene that is about to be written in the FBX file.

◆ WriteParameters()

virtual void WriteParameters ( FbxObject pParams)
virtual

Virtual function called once when the FBX SDK is about to write plug-in's parameters.

Users can re-implement it in their plug-in if they need to store properties in the FBX file for their own usage. The object in parameter is used to store those properties. If not re-implemented, this function does nothing.

Parameters
pParamsAn abstract object that can be used as a property container, to allow the plug-in to store properties about the plug-in.

◆ WriteEnd()

virtual void WriteEnd ( FbxScene pScene)
virtual

Virtual function called once after the FBX SDK wrote an FBX file.

Users can re-implement it in their plug-in if they need to perform tasks at that moment. The scene provided in parameter can be altered, but the changes will not appear in the FBX file. If not re-implemented, this function does nothing.

Parameters
pSceneThe scene that was written in the FBX file.

◆ ReadBegin()

virtual void ReadBegin ( FbxScene pScene)
virtual

Virtual function called once when the FBX SDK is about to read an FBX file.

Users can re-implement it in their plug-in if they need to perform tasks at that moment. The scene provided in parameter can be altered. If not re-implemented, this function does nothing.

Parameters
pSceneThe scene that is about to be read in the FBX file.

◆ ReadParameters()

virtual void ReadParameters ( FbxObject pParams)
virtual

Virtual function called once after the FBX SDK reads the plug-in's parameters.

Users can re-implement it in their plug-in if they need to retrieve properties for their own usage. The object in parameter is used to retrieve those properties. If not re-implemented, this function does nothing.

Parameters
pParamsAn abstract object that can be used as a property container, to allow the plug-in to read properties about the plug-in.

◆ ReadEnd()

virtual void ReadEnd ( FbxScene pScene)
virtual

Virtual function called once after the FBX SDK read an FBX file.

Users can re-implement it in their plug-in if they need to perform tasks at that moment. The scene provided in parameter can be altered. If not re-implemented, this function does nothing.

Parameters
pSceneThe scene that was read in the FBX file.

◆ GetDefinition()

const FbxPluginDef& GetDefinition ( ) const

Accessor to the plug-in definition structure that contains basic information on the plug-in like its name or version.

This is the only method available to differentiate plug-ins.

Returns
The definition structure for this plug-in.

◆ GetModuleHdl()

FbxModule GetModuleHdl ( )

Retrieve the module address pointer for this plug-in.

With this module instance handle, for example someone can query procedures addresses, allowing more complex interactions, as well as other operating system module specific functions.

◆ GetData() [1/2]

FbxPluginData& GetData ( )
protected

Accessor to the plug-in private data.

Returns
The data for the current plug-in.

◆ GetData() [2/2]

const FbxPluginData& GetData ( ) const
protected

Const accessor to the plug-in private data.

Returns
The const data for the current plug-in.

The documentation for this class was generated from the following file: