MakeTag(Tplugin) ???
-
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 -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/01/2003 at 02:33, xxxxxxxx wrote:
First, is 'Alive' and pluginobject (ObjectData)? the node should be your object.
Second, you should not be using MakeTag() (AFAIK), but PluginTag::Alloc(plugID), then insert the tag onto the object, MakeTag() has no parameter for the pluginID! -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/01/2003 at 02:55, xxxxxxxx wrote:
Thanks! It works.
To First: Yes, "Alive" is a pluginobject (object plugin?). I tried to implement the creation of my child objects inside the Alive::Init(...) function before, but I didn't work. Now it works!
To second: If everything would be so simple! -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/01/2003 at 03:00, xxxxxxxx wrote:
Supplement: The node data of the MSG_MENUPREPARE message is really only the document (or do I misinterpret the SDK-Help?) :
>>MSG_MENUPREPARE_<_h4_>_
Allows tags, objects, shaders etc. to do some setup work when called from the menu. The corresponding data is the curre_ <_a class=link href= "mk:@msitstore:i:\dokumentationen\r8sdkchm2002-10-29.chm::/pages/c4d_basedocument/class_basedocument31.html"_>_l">SPAN title=class BaseDocument : public BaseList2D"> color=#800080BaseDocument/SPAN.
<<
from SDK-HTML Help -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/01/2003 at 05:18, xxxxxxxx wrote:
not sure about that, if you look at the SDK examples, say the Spherify:
Bool Spherify::Message(GeListNode *node, LONG type, void *data) { if (type==MSG_MENUPREPARE) { ((BaseObject* )node)->SetDeformMode(TRUE); } return TRUE; }
it should be the object, it always has been before (in XL7 for example), it was the plugin tag/object?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/01/2003 at 05:37, xxxxxxxx wrote:
You're right. It works as well as inside the Init-function ;-).
What do you think is better (cleaner)? Init or MSG_MENUPREPARE?
(I will add some more objects and tags to this)op = (BaseObject* )node; doc = node->GetDocument(); cp = Get_ObjectByName(op, "actors"); // my search object function limited to parent op 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); tag = PluginTag::Alloc(ID_ALIVEOBJECT+1); if (tag) ap->InsertTag(tag, NULL); ap->Message(MSG_UPDATE);
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/01/2003 at 06:28, xxxxxxxx wrote:
I'm not actually sure what the difference is, other than Init is called very early on, so I assume the message is done later in the pipeline, the only point about Init I saw was in the docs it said:
Note: If your class has a constructor it is called as usual before this function, but at that time there's no GeListNode link established.
So maybe in Init it might be too early and cause problems, it sounds like Init is for BaseContainer setting up and member variables, not doing anything with the object or document, probably why that message is there