THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/03/2010 at 23:33, xxxxxxxx wrote:
ok, it works here, too.
here is my whole code:
#define pluginID 1000001
#include "c4d.h"
#include "c4d_symbols.h"
#include "customgui_description.h"
#define pluginName "testObj"
class testObj : public ObjectData
{
INSTANCEOF(testObj,ObjectData);
public:
virtual Bool Init(GeListNode *node);
virtual BaseObject* GetVirtualObjects(PluginObject *op, HierarchyHelp *hh);
virtual Bool Message(GeListNode *node, LONG type, void *t_data);
static NodeData *Alloc(void) { return gNew testObj; }
};
Bool testObj::Init(GeListNode *node)
{
BaseObject *op = (BaseObject* )node;
BaseContainer *data = op->GetDataInstance();
return TRUE;
}
Bool testObj::Message(GeListNode *node, LONG type, void *t_data)
{
if (type==MSG_DESCRIPTION_VALIDATE)
{
BaseContainer *data = ((BaseObject* )node)->GetDataInstance();
}
return TRUE;
}
BaseObject *testObj::GetVirtualObjects(PluginObject *op, HierarchyHelp *hh)
{
PolygonObject *obj = NULL;
Vector *padr=NULL;
CPolygon *vadr=NULL;
obj = PolygonObject::Alloc(4,1);
if (!obj) goto Error;
padr=obj->GetPointW();
vadr=obj->GetPolygonW();
padr[0] = Vector(-100,0,-100);
padr[1] = Vector(-100,0,100);
padr[2] = Vector(100,0,100);
padr[3] = Vector(100,0,-100);
vadr[0] = CPolygon(0,1,2,3);
return obj;
Error:
return NULL;
}
Bool Register_testObj(void)
{
return RegisterObjectPlugin(pluginID,pluginName,OBJECT_GENERATOR|OBJECT_INPUT,testObj::Alloc,"OtestObj","testObj.tif",0);
}
hope it works for you..