Reading geometry's detail in attributewrangler?

   1835   2   1
User Avatar
Member
301 posts
Joined: July 2005
Offline
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
User Avatar
Member
205 posts
Joined: Jan. 2014
Offline
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
@attrib
or in your case
f@k

Use the input numbers instead of
"op:/obj/geo1"
"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
detail(0, "k");

Let me know if smth is unclear
Edited by anon_user_09389530 - Sept. 19, 2021 01:24:42
I contribute to the beauty of this world
https://houdininotes.ivanlarinin.com/ [houdininotes.ivanlarinin.com]
User Avatar
Member
2658 posts
Joined: June 2008
Offline
There is even more space dust on your piece of code.
k is a vector 2, not a vector (which defaults to 3).
https://www.sidefx.com/docs/houdini/vex/lang#data-types [www.sidefx.com]

Attachments:
Untitled-1.jpg (167.5 KB)

Using Houdini Indie 20.5
Windows 11 64GB Ryzen 16 core.
nVidia 3060RTX 12BG RAM.
  • Quick Links