THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/04/2008 at 03:20, xxxxxxxx wrote:
AS Robert said the best way would be to use a SceneHook and check for MSG_DOCUMENTINFO.
here a little example:
> \> #include "c4d.h" \> #include "c4d_symbols.h" \> \> \> class MyHook : SceneHookData \> { \> public: \> virtual LONG Execute(PluginSceneHook \*node, BaseDocument \*doc, BaseThread \*bt, LONG priority, LONG flags); \> virtual Bool Message(GeListNode \*node, LONG type, void \*data); \> \> static NodeData \*Alloc(void) { return gNew MyHook; } \> }; \> \> LONG MyHook::Execute(PluginSceneHook \*node, BaseDocument \*doc, BaseThread \*bt, LONG priority, LONG flags) \> { \> return EXECUTION_RESULT_OK; \> } \> \> Bool MyHook::Message(GeListNode \*node, LONG type, void \*data) \> { \> switch(type) \> { \> case MSG_DOCUMENTINFO: \> { \> DocumentInfoData \*info = (DocumentInfoData\* )data; \> if(info->type == MSG_DOCUMENTINFO_TYPE_LOAD) \> { \> GePrint("document loaded"); \> } \> } \> } \> \> return TRUE; \> } \> \> #define ID_MYHOOK 1022492 //use your own unique plugin ID \> \> Bool RegisterMyHook(void) \> { \> // decide by name if the plugin shall be registered - just for user convenience \> String name=GeLoadString(IDS_MYHOOK); if (!name.Content()) return TRUE; \> return RegisterSceneHookPlugin(ID_MYHOOK,name,0,MyHook::Alloc,EXECUTION_RESULT_OK,0); \> } \>
cheers,
Matthias