On 08/12/2014 at 03:41, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R14
Platform: Windows ;
Language(s) : C++ ;
---------
Hi Folks,
what's the correct way to get/set a class level BaseObject link/reference? I've been trying with saving the scene and using a base link in a GeData's BaseList2D variable like the following:
MyObject::Write(..)
{
GeData data;
data.SetBaseList2D((BaseList2D* )MyClassLevelObject);
hf->WriteGeData(data);
}
And in the Read() I'm doing variations like this:
MyObject::Read(GeListNode *node,HyperFile *hf,LONG Level)
{
BaseDocument *doc = node->GetDocument();
GeData data;
hf->ReadGeData(&data);
GePrint("data's type = " + LongToString(data.GetType())); // prints type 133 = alias link
MyClassLevelObject = (BaseObject* )data.GetLink(doc,NULL); // returns NULL
}
What's my undoing here?
WP.