On 24/04/2014 at 16:21, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R14
Platform: Windows ;
Language(s) : C++ ;
---------
Hi,
I have roughly the following code in my ObjectData Modifier plugin - which is inside a function which gets called from MyPlugin::ModifyObject() - and iterates through the objects in an INEXCLUDE list, checks the type of each object and does some stuff..
void iterateObjects(BaseContainer* data)
{
BaseDocument *doc = GetActiveDocument();
GeData d;
d = data->GetData(MYPLUGIN_INCLUDE);
objList = (InExcludeData* )d.GetCustomDataType(CUSTOMDATATYPE_INEXCLUDE_LIST);
if (objList == NULL)
{
objCount = 0;
}
else
{
objCount = objList->GetObjectCount();
}
if (objCount != 0)
{
for (LONG i=0; i<objCount; i++)
{
BaseList2D* bl = objList->ObjectFromIndex(doc, i);
BaseObject *curObj = (BaseObject* )bl;
if (bl->GetTypeName() == "Cloner")
{
// Do some stuff..
}
else
{
// Do some other stuff..
}
}
}
}
This works perfectly until i render my scene - it immediately stops with the following:
> MyPlugin.cdl!BaseList2D::GetTypeName() Line 40 + 0x38 bytes C++
Debugging my objects within VS while C4D is still running, the objCount variable is reading correctly, but the ObjList->ObjectFromIndex() result is coming up empty from what i can make out.
Like i said this is fine when not rendering..
Any clues why this might be happening?