On 12/08/2014 at 08:57, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R14
Platform: Windows ;
Language(s) : C++ ;
---------
Hi,
I am trying to use SMC CurrentStateToObject inside my GetVirtualObjects function. It is actually working and returning the object however it is ignoring the Displacer object in my hierarchy..
The way it is set up is roughly:
Inside GetVirtualObjects i call a function which returns myObject
. MyObject is basically a null, with a cube inside it, and a Displacer object as a child of the cube. I then run currentstatetoobject on the returned object and GetVirtualObjects returns the result.
It appears to work fine, as my cube comes back however it is ignoring the Displacer..
Any clues why this might be?? I`ve tried setting various flags on both smc and csto but no avail..
Here`s roughly my GVO code:
BaseObject* MyPlugin::GetVirtualObjects(BaseObject* op, HierarchyHelp* hh)
{
myObject = CreateObject((BaseObject* )(op));
ModelingCommandData cd;
cd.op = myObject;
cd.doc = op->GetDocument();
cd.mode = MODELINGCOMMANDMODE_ALL;
cd.flags = MODELINGCOMMANDFLAGS_CREATEUNDO;
if (SendModelingCommand(MCOMMAND_CURRENTSTATETOOBJECT, cd))
{
GePrint("returning SMC");
return static_cast<BaseObject*>(cd.result->GetIndex(0));
}
else
{
GePrint("returning non-SMC");
return myObject;
}
return myObject;
}