On 05/02/2015 at 06:37, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R16
Platform: Mac OSX ;
Language(s) : C++ ;
---------
Hi,
I've copied the lookatcamera plugin and edited it to my needs.
The only problem is, it doesn't load anymore.
Here is my code inside main.cpp:
#define ID_RESETROTCD 1000010
#include "c4d.h"
#include "c4d_symbols.h"
#include "resetrotcd.h"
#include "lib_description.h"
#include "customgui_priority.h"
class ResetRotCD : public TagData
{
public:
virtual Bool Init(GeListNode* node);
virtual EXECUTIONRESULT Execute(BaseTag* tag, BaseDocument* doc, BaseObject* op, BaseThread* bt, Int32 priority, EXECUTIONFLAGS flags);
static NodeData* Alloc(void) {return NewObjClear(ResetRotCD);}
};
Bool ResetRotCD::Init(GeListNode* node)
{
BaseTag* tag = (BaseTag* )node;
BaseContainer* dataObjectOne = tag->GetDataInstance();
BaseContainer* dataObjectTwo = tag->GetDataInstance();
BaseDocument* doc = C4DOS.Ge->GetActiveDocument();
dataObjectOne->GetLink(OBJECT_ONE, doc);
dataObjectTwo->GetLink(OBJECT_TWO, doc);
return true;
}
EXECUTIONRESULT ResetRotCD::Execute(BaseTag* tag, BaseDocument* doc, BaseObject* op, BaseThread* bt, Int32 priority, EXECUTIONFLAGS flags)
{
GePrint("The ResetRotCD-tag is executed now!");
return EXECUTIONRESULT_OK;
}
Bool PluginStart(void)
{
return RegisterTagPlugin(ID_RESETROTCD, GeLoadString(IDS_RESETROTCD), TAG_EXPRESSION | TAG_VISIBLE, ResetRotCD::Alloc, "resetrotcd", NULL, 0);
}
void PluginEnd(void)
{
}
Bool PluginMessage(Int32 id, void *data)
{
return TRUE;
}
And inside resetrotcd.h:
#ifndef RESETROTCD_H__
#define RESETROTCD_H__
enum
{
OBJECT_ONE = 1000,
OBJECT_TWO
};
#endif // RESETROTCD_H__
And inside resetrotcd.res:
CONTAINER resetrotcd
{
NAME resetrotcd;
INCLUDE Obase;
GROUP ID_TAGPROPERTIES
{
LINK OBJECT_ONE {}
LINK OBJECT_TWO {}
}
}
Does anybody see the problem?
PS: How do I put my code in a nice block?
Thanks for your time and help!
Greetings,
Casimir Smets