I make a detail attribute called orids
const char * attName= "orids";
GA_RWAttributeRef oridsAtt = gdp->findIntTuple(GA_ATTRIB_GLOBAL, attName, setSize);
if (!oridsAtt.isValid())
{
oridsAtt = gdp->addIntTuple(GA_ATTRIB_GLOBAL, attName, setSize);
}
GA_RWHandleI oridsHandle(oridsAtt.getAttribute());
and I want to populate it from values that I have stored in a set. I probably have to convert the set to an array, but whatever I try, I cannot set the values except for the first array item. For example, as a test, this will just set the first array item to 5 and leave all others on 0:
GA_Size gasize(setSize);
GA_Offset gaoffset;
int test[] = {1,2,3,4,5};
oridsHandle.setBlock(gaoffset, gasize, test);
I also tried looping over the set and setting the attribute that way:
int i=0;
for (set<int>::iterator it=oridsSet.begin();it!=oridsSet.end(); ++it)
{
oridsHandle.set(GA_Offset(i++),*it);
}
But again, it only sets the value in the very first array position.
How do I set array detail attributes?