Large array problem

Large array problem

Anonymous
Not applicable
454 Views
4 Replies
Message 1 of 5

Large array problem

Anonymous
Not applicable
Hello,

I'm saving vertex normals in an Point3 array. If the array gets larger (more than 50000 elements) the plugin doesn't work anymore. I think the heap is too small. Is it possible to increase the heap size? Or is there another way to handle such large arrays?
0 Likes
455 Views
4 Replies
Replies (4)
Message 2 of 5

stigatle
Enthusiast
Enthusiast
if you don't post some code or explain how you handle the array's then we cannot help you.

Heapsize is for maxscript only, is it not?
0 Likes
Message 3 of 5

Anonymous
Not applicable
Here's my code:

MeshNormalSpec * meshNorm2 = mesh2.GetSpecifiedNormals();
Point3 *normalValues = (Point3*)MAX_malloc(NumNormals2*sizeof(Point3));

// save normals in an array
if(meshNorm2 && meshNorm2->GetNumNormals())
{
for (int faceIndex = 0; faceIndex < NumFaces2; faceIndex++)
{
for (int j = 0; j < 3; j ++)
{
normalValues = meshNorm2->GetNormal(faceIndex, j);
}
}
}


With small objects (20000 normals) it works, but with larger objects (200000 normals) Max crashes. I'm using Max 2010 32 bit.
0 Likes
Message 4 of 5

stigatle
Enthusiast
Enthusiast
does it exceed the limit for ram for a 32bit application?
(check with task manager how much ram it uses before it crashes).
0 Likes
Message 5 of 5

Anonymous
Not applicable
No, the memory is ok. Strangely enough it works today, although I didn't change anything.
However thank you for help.
0 Likes