THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 28/01/2003 at 11:10, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.012
Platform: Windows ; Mac OSX ;
Language(s) : C.O.F.F.E.E ; C++ ;
---------
Hi,
this is my first topic...
After working with the c4d sdk for a couple of days, I cannot avoid to ask something here:
I'm working on a plugin-set consisting of an object plugin, that creates a kind of scene object and some expression tag plugins.
When the user creates the scene object, I want to create a complete setup with some child objects inside the master scene object. My attempts to do this, when the Message function gets "MSG_MENUPREPARE" failed, because the node data is the BaseDocument (maybe the scene object isn't created at that time?).
OK. This is not my main problem - I solved this so long by assigning a button to the object properties, that will do this. This works.
BUT: I want to assign one of my expression tags. MakeTag(Tplugin) doesn't work (a test with MakeTag(Tphong) works, so my code seems to be ok so far).
How can I assign a specific plugin/expression tag to my newly created (Null-)Objects?
Bool Alive::Message(GeListNode *node, LONG type, void *data)
{
BaseObject *op;
BaseDocument *doc;
BaseObject *cp, *ap;
switch (type)
{
case MSG_DESCRIPTION_COMMAND:
DescriptionCommand *dc = (DescriptionCommand* ) data;
if (dc->id[0].id==ALIVE_CREATEACTOR)
{
op = (BaseObject* )node;
doc = node->GetDocument();
cp = Get_ObjectByName(op, "actors");
if (!cp)
{
cp = BaseObject::Alloc(Onull);
cp->SetName("actors");
doc->InsertObject(cp, op, NULL, 0);
cp->Message(MSG_UPDATE);
}
ap = BaseObject::Alloc(Onull);
ap->SetName("actor");
doc->InsertObject(ap, cp, NULL, 1);
if (!ap->MakeTag(Tplugin))
GePrint("Tag-Error!"); // <<< I'LL GET THIS ERROR
ap->Message(MSG_UPDATE);
}
break;
}
return TRUE;
}
BTW: MakeTag(Texpressionplugin) cannot be compiled!?
MS VC6: error C2065: 'Texpressionplugin' : nichtdeklarierter Bezeichner