THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 07/12/2004 at 14:34, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.200
Platform: Mac OSX ;
Language(s) : C.O.F.F.E.E ; C++ ;
---------
Hi,
In trying to learn the ropes of CPP object plugin development and I realize that I don't understand how to display the child objects of the plugin in GetVirtualObjects.
For now, as a simplification of what I am really trying to do, I am essentially trying to create an object plugin that would behave as a Null Object.
From the atom.cpp I am creating instances of the children and attaching them to the plugin object, which works, but when I just try to attach the child itself to the returnObject I get a crash. As I step through the children, how do I attach them to the returnObject in GetVirtualObjects? Or, in the code below, what do I add between the comments with question marks?
BaseObject *MyNullObject::GetVirtualObjects(PluginObject *pluginObject, HierarchyHelp *hh)
{
BaseObject* returnObject = NULL;
BaseObject* orig;
BaseObject* res;
BaseObject *obi = NULL;
Bool dirty;
BaseContainer* data = pluginObject->GetDataInstance();
// request polygonized input
hh->AddVFlags(VFLAG_POLYGONAL);
orig = pluginObject->GetDown();
if (!orig) return NULL;
dirty = FALSE;
res = pluginObject->GetAndCheckHierarchyClone(hh,orig,HCLONE_ASPOLY,&dirty;,NULL,TRUE);
if (!dirty) {
return res;
}
if (!res) {
return NULL;
}
returnObject = BaseObject::Alloc(Onull);;
// STEP TRHOUGH EACH CHILD OF THE PLUGIN ONBJECT
while (orig) {
BaseContainer *origdata = orig->GetDataInstance();
// ??? WHAT SHOULD I DO HERE TO JUST DISPLAY/RETURN THE CHILDREN INSTEAD OF INSTANCING THEM?
obi = BaseObject::Alloc(Oinstance);
AutoAlloc<BaseLink> link;
if (link) {
link->SetLink(orig);
obi->SetParameter(DescLevel(INSTANCEOBJECT_LINK), GeData(link), 0);
}
// ????
obi->InsertUnderLast(returnObject);
orig = orig->GetNext();
}
if (!returnObject) goto Error;
returnObject->SetName(pluginObject->GetName());
return returnObject;
Error:
blDelete(returnObject);
return NULL;
}