c4d_plugin.h File Reference

Classes

struct   C4DPL_CommandLineArgs
struct   C4DPL_EditImage
struct   C4DPL_DeviceChange
struct   C4DPL_NetRenderResult

Macros

#define  C4DPL_VERSION
#define  C4DPL_ERROR
#define  C4DPL_ERROR_VERSION
#define  C4DPL_INIT_SYS
#define  C4DPL_INIT
#define  C4DPL_END
#define  C4DPL_INIT_VERSION
#define  C4DPL_MESSAGE
#define  C4DMSG_PRIORITY
#define  C4DPL_BUILDMENU
#define  C4DPL_INIT_PRIORITY_XTENSIONS
#define  C4DPL_INIT_PRIORITY_OBJECTS
#define  C4DPL_INIT_PRIORITY_MODELING
#define  C4DPL_INIT_PRIORITY_SHADER
#define  C4DPL_INIT_PRIORITY_ADVANCEDRENDER
#define  C4DPL_INIT_PRIORITY_MOCCA
#define  C4DPL_INIT_PRIORITY_NEWMAN
#define  C4DPL_INIT_PRIORITY_SLA
#define  C4DPL_INIT_PRIORITY_MODULES
#define  C4DPL_INIT_PRIORITY_PLUGINS
#define  C4DPL_STARTACTIVITY
#define  C4DPL_ENDACTIVITY
#define  C4DPL_COMMANDLINEARGS
#define  C4DPL_ENDPLUGINACTIVITY0
#define  C4DPL_ENDPLUGINACTIVITY1
#define  C4DPL_ENDPLUGINACTIVITY2
#define  C4DPL_CHANGEDSECURITYTOKEN
#define  C4DPL_SHUTDOWNTHREADS
#define  C4DPL_LAYOUTCHANGED
#define  C4DPL_RELOADPYTHONPLUGINS
#define  C4DPL_EDITIMAGE
#define  C4DPL_ENDPROGRAM
#define  C4DPL_DEVICECHANGE
#define  C4DPL_NETWORK_CHANGE
#define  C4DPL_SYSTEM_SLEEP
#define  C4DPL_SYSTEM_WAKE
#define  C4DPL_PROGRAM_STARTED
#define  C4DPL_REGISTERPYPLUG
#define  C4DPL_NETRENDERRESULT
#define  SetPluginPriority (data, i)

函数

Bool   PluginStart (void)
void  PluginEnd (void)
Bool   PluginMessage ( Int32 id, void *data)

Macro Definition Documentation

◆  C4DPL_VERSION

#define C4DPL_VERSION

The version of Cinema 4D plugin API.

◆  SetPluginPriority

#define SetPluginPriority (   data,
 
)

Sets the priority for a plugin.

参数
[in] data The message data of the priority message.
[in] i The plugin priority. Build the priority from one of the base priorities: C4DPL_INIT_PRIORITY

Function Documentation

◆  PluginStart()

Bool PluginStart ( void  )

Called when a plugin is loaded from Cinema 4D . Think of it as the equivalent to the usual main() 函数。
Here register all the plugin types and initialize them.
For example, the basics needed are:

Bool PluginStart () { if (! g_resource . Init ()) return false ; // Do not start plugin without resource

if (!RegisterMyPlugin()) return false ;
return true ; }
返回
true if the plugin was loaded, otherwise false .

◆  PluginEnd()

void PluginEnd ( void  )

Called when the plugin is unloaded from Cinema 4D .
Here free the plugin registrations and any resources which are not owned or already freed by other plugins (see PluginMessage() ).
To free complex structures from other modules see C4DPL_ENDACTIVITY.
例如:

void PluginEnd ( void ) { FreeMyPlugin(); }

◆  PluginMessage()

Bool PluginMessage ( Int32   id ,
void *  data  
)

Called to receive plugin messages.
These can either be from Cinema 4D or from other plugins via GePluginMessage() . Here is an example:

Bool PluginMessage ( Int32 id , void *data) { switch ( id ) { case C4DMSG_PRIORITY : SetPluginPriority (data, C4DPL_INIT_PRIORITY_PLUGINS +100); return true ; case MY_MESSAGE: ... return true ; } return false ; }
参数
[in] id The message ID. Built-in ones are: C4DPL_MESSAGES
[in] data The message data.
返回
true if the message was consumed, otherwise false .
GeResource::Init
Bool Init()
C4DMSG_PRIORITY
#define C4DMSG_PRIORITY
Called to query plugins about their loading time priority. Answer with SetPluginPriority(),...
定义: c4d_plugin.h:38
C4DPL_INIT_PRIORITY_PLUGINS
#define C4DPL_INIT_PRIORITY_PLUGINS
Base priority for plugins.
定义: c4d_plugin.h:56
SetPluginPriority
#define SetPluginPriority(data, i)
定义: c4d_plugin.h:198
Int32
maxon::Int32 Int32
定义: ge_sys_math.h:58
PluginMessage
Bool PluginMessage(Int32 id, void *data)
Bool
maxon::Bool Bool
定义: ge_sys_math.h:53
g_resource
GeResource g_resource
Global resources for Cinema 4D.
PluginEnd
void PluginEnd(void)
PluginStart
Bool PluginStart(void)