Hi every one !
I'm currently working on a support for particle read and write inside maya. I'm working on the final step with testing on real production data.
I will send a push request when everything is stable.
Reading default IPointSchema data works without issue. But my implementation tries to get all possible geomparam as well.
My production alembic file comes from houdini. It is a foam simulation with at most 73846 particles.
Reading positionm velocity and width works fine, but the IPointSchema also has two arbGeomParam, "life" and "age" (custom particle attributes)
when the reader reach a sample with lots of particles (it is not consistent), I get a Segmentation Fault
Here is my code:
// Array property comes from somewhere else in the code
Alembic::Abc::IArrayProperty arrayProp;
Alembic::AbcCoreAbstract::ArraySamplePtr samp;
arrayProp.get(samp, Alembic::Abc::ISampleSelector(index));
unsigned int sampSize = (unsigned int)samp->size();
MDoubleArray doubleArray;
doubleArray.setLength(sampSize);
double * vals = (double *) samp->getData();
// Looping here on purpose to check when it's failing
for (unsigned int i = 0; i < sampSize; ++i)
{
doubleArray[i] = vals[i];
}
At that particular moment, sampSize == 16972
the segmentation fault hits when reaching element 9493
I tried feeding the MDoubleArray with contant value to make sure the error doesn't comes from the maya object and it works fine.
What could be my mistake here ? if the data returned by the alembic sample is not the size returned by getSize(), what could I do ?
Best,
Hans