cancel
Showing results for 
Search instead for 
Did you mean: 

What causes a ":Invalid index in access to collection" error in 3D VEA 8.0

0 Kudos

I am writing (what I thought would be) a simple 3D tool for 3D Visual Enterprise Author 8.0 that would collapse all nodes that have _prt_ in the name. The tool appears to run as expected except that it gives a "[Fatal]:Invalid index[385] in access to collection" error after my code has finished and then crashes the program. I am able to read debug messages I sent to the message log while the error dialogue is being displayed but am unsure whether the code has actually worked as the program crashes when I dismiss the dialogue.

My code is:

bool _E3_CALLTYPE E3_CONVERT::ProcessObject(rh::e3::Node* node,rh::Context* context,UINT32 flags)
{

char name[256] = {0};
node->GetName(name,_countof(name));

if (strstr(name, "_prt_"))
{
items = api->CreateCollection();
e3_MESH * mesh = (e3_MESH *)scene->CreateObject("e3_mesh");
MATRIX3D m;
node->GetWorldMatrix(&m, E3_GM_OBJECT);
scene->Collapse(mesh, &m, items, E3_COLLAPSE_OPTIMIZE);
items->Release();
while (node->childs) node->RemoveChild(node->childs);
node->SetObject(mesh);
mesh->Release();
}

return TRUE;
}

Accepted Solutions (0)

Answers (1)

Answers (1)

vladimir_noskov
Participant
0 Kudos

Hi Russel,

It is not easy to tell, are you calling ProcessObject for all objects like list_all?

Vlad