Search - User list
Full Version: Alembic point cloud, how to copy detail to points
Root » Technical Discussion » Alembic point cloud, how to copy detail to points
Orsonorix
Hi
I have alembic with point cloud exported from Max tyflow , and age of particles is stored in detail. It looks like I need to read _age and assign it to corresponding point, but I can read only first value. There is everything in spreadsheet but can't read chosen value. If I use

f@age = detail(0,“_age”,0);
I will get first _age and that is correct but if I use

f@age = detail(0,"_age",0);
I get 0 and that is wrong.

There is different value in spreadsheet on detail _age. Same problem if color is exported it also lands in detail in this form. If Velocity is exported it's stored on points as usually

Scene with simple alembic in attachment.

Thanks
c0y
It's because your details attribute is an Array “_age”
If you want to read it, you need to get the array in a
float _age[] = detail(0, "_age")
; and then read it with
f@age = _age[index]

try to paste this is a detailwrangle :

float value;
int pNum = attribsize(0, "detail", "_age");
float _age[] = detail(0, "_age");

for (int i = 0; i < pNum; i++)
{
    value = _age[i];
    setpointattrib(0, "age", i, value, "set");
}
Orsonorix
You helped me a lot! Now I know what was wrong.
Thanks!
Sam Mason
Hey! felt lucky to find this.

I'm having the same issue but trying to get the orientation from tyflow.

It also comes as a string out of values in the detail, except since its a vector4 how would I loop through every four values and convert them to an vector4 orient attribute?

Thanks!!
Orsonorix
Hey,

I did it like this:


vector4 valueq;
int pNum = attribsize(0, "detail", "_orientation");
vector4 _orientation[] = detail(0, "_orientation");

for (int i = 0; i < pNum; i++)
{
    valueq = _orientation[i];
    setpointattrib(0, "orient", i, valueq, "set");
}

Hope it helps
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB