THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/06/2004 at 08:51, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.206
Platform:
Language(s) : C++ ;
---------
Hi,
Having a bit of trouble inserting an cloned object into a BaseContainer.
Im doing a simple CurrentStateToObject command, and want to add the returned object into the BC.
ModelingCommandData cd;
cd.doc = GetActiveDocument();
cd.op = op;
if(!SendModelingCommand(MCOMMAND_CURRENTSTATETOOBJECT,cd)) return FALSE;
BaseObject *oClone = (BaseObject* )cd.result1;
BaseContainer *bctag = tag->GetDataInstance();
bctag->SetLink(DUMMY, oClone);
BaseObject *object = bctag->GetObjectLink(DUMMY,GetActiveDocument());
As you can see, I directly read the link back again, but object variable is always NULL.
What confuses me is
bctag->SetLink(DUMMY,op)
works. Both op and oClone are of type BaseObject* so I can't see why one works and the other don't