Reading geometry's detail in attributewrangler?
1835
2
1
Sept. 19, 2021 12:38 a.m.
vector dk = detail ("op:/obj/geo1" ,"k" );
float pk = point ("op:/obj/geo1" ,"k" ,@ptnum );
//printf("pk = %f\n",pk);
printf ("dk = %f, %f \n " ,dk [0 ],dk [1 ]);
float rr = (pk -dk [0 ])/(dk [1 ]-dk [0 ]);
@Cd .r = rr ;
@Cd .g = rr ;
@Cd .b = rr ;
I am trying to read a pair of detail level attribute but I am getting zeros and not those I see in the spreadsheet, what am I doing wrong ? I can see the k and k has values 0 and 16 but my print out says zero.
Thank you.
Attachments:
SideFX_Forum_VEX.png (360.9 KB)
Nicholas Yue
Sept. 19, 2021 1:23 a.m.
I see two things here at the first glance
float pk = point ("op:/obj/geo1" ,"k" ,@ptnum );
if you need just the point attribute from the same geo, you can just type
or in your case
Use the input numbers instead of
"op:/obj/geo1" is the obj node btw and not the sop level node, not sure how would it behave.
mb smth like that would work better
Let me know if smth is unclear
Edited by anon_user_09389530 - Sept. 19, 2021 01:24:42