Skip to Content
0

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

Dec 31, 2016 at 05:53 AM

55

avatar image
Former Member

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;
}

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member
Jan 11, 2017 at 03:14 AM
0

Hi Russel,

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

Vlad

Share
10 |10000 characters needed characters left characters exceeded