THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/04/2008 at 10:01, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10.5
Platform: Windows ;
Language(s) : C++ ;
---------
Here's another problem: I have to set some data in the object's containers when the tag is closed. Right now this is done by the following source code:
> <code>
> void MoCap::SetBackIDs (){
>
> BaseDocument *doc = GetActiveDocument();
> GePrint ("doc");
> BaseTag *tag = doc->GetActiveTag();
> GePrint ("tag");
> BaseObject *op = doc->GetFirstObject();
> GePrint ("op");
> BaseObject *current;
> GePrint ("current");
> BaseContainer *opContainer = op->GetDataInstance();
> GePrint ("opContainer");
>
> while (op!= NULL){
> GePrint ("while");
> opContainer = op->GetDataInstance();
> opContainer->SetBool (DESC_USED, FALSE);
> opContainer->SetLong (DESC_JOINT_ID, 0);
> current = op->GetDown();
> if (current == NULL)
> current = op->GetNext();
> if (current == NULL)
> current = op->GetUp()->GetNext();
> op = current;
> }
>
> }
> </code>
while the method SetBackIDs is called within the destructor of my Plugin:
> <code>
> ~MoCap(void) {SetBackIDs();}
> </code>
I'm sure that this is not very clever. It works, but when finishing Cinema the destructor is called again and only finds the document. When searching for the active tag or the first object, Cinema crashes. How do I solve this one?
Thx