how to loop on vdbs(name is unkown) in volume wrangle

   1065   0   0
User Avatar
Member
9 posts
Joined: April 2020
Offline
before i resample all the vdbs, i dit a lot of caculation in the vex. I caculate the rest position of voxel, and use the rest to sample the original vdb. Now i want to loop over all the vdbs the wrangle recieved, but i found that i can only edit the vdb by @volume_name?? what if i don't know it or i just want to use primtive index to get it?


int prim=0;
vector uvw={0,0,0};
float dist=xyzdist(1,@P,prim,uvw);
vector P = primuv(1,“P”,prim,uvw);
matrix3 m = primuv(1,“m”,prim,uvw);



vector up = set(m.xx,m.xy,m.xz);
vector N = set(m.yx,m.yy,m.yz);

vector rest={0,0,0};

rest=dot((P-@P),N)/length2(N);
rest=dot((@P-P),up)/length2(N);
restuvw-chf(“../pointwrangle2/offset”))/chf(“../pointwrangle2/stretch”)*prim(1,“curveLength”,0);

for(int i=0;i<6;i++){
@volume_name=volumesample(2,i,rest); //i hope this step i can use i to get the vdb
}
  • Quick Links