Hello everybody!
After exploring POPs’ API and Samples/CPlusPlus (and experimenting with “normal” buffer creation) I couldn’t really find out how to properly create new array attributes and manipulate them (what structure represents it internally? array of arrays? single array? etc) inside a custom C++ POP. I suppose initial size in bytes should be something like NUM_PTS * NUM_COMPONENTS * ARRAY_SIZE * sizeof(ATTR_TYPE) (e.g. 10k x 3 x 5 x 4 for 10k points and an array of 5 float3 per each point) - at least that’s what I’ve tried, but TD freezes as soon as I load the DLL, so I couldn’t really even try adding data to it…
Any help greatly appreciated!
Please let me know if I can provide more infos
Hello @hoolywear
When creating the new attribute with setAttribute, are you specifying that the new attribute is an array in the POP_AttributeInfo (info.arraySize = ARRAY_SIZE)? Would you be able to share a sample so we can determine what might be causing the issue?
Hi @Guillaume.L , yes I did specify that. I’ll wire the example back up tomorrow (the first experiments went nowhere so I trashed them and moved on
), but what about the internal structure I should use? Is an array of arrays fine? Or maybe I am missing the point…
Experiments actually went good. I am creating a buffer with initial size as above, retrieving it as a pointer like usual, and working on it in a strided fashion (with K array elements, each K elements represent the array attribute for a point). After that, you specify the correct array size in the POP_AttributeInfo and output works perfectly (not sure why I had issues previously).
Nonetheless, following this topic it would be nice to have examples or more documentation regarding all types of buffers created “from scratch” (not from inputs).
Thx for reaching out!