Reading "Intersection Analysis" SOP Results in VEX

   1441   2   1
User Avatar
Member
8 posts
Joined: June 2022
Offline
Hi there, I'm trying to read the "Primitive UVW" attribute generated by an Intersection Analysis SOP node in my VEX code. The attribute in question is an array of float tuples and I have no idea how I'd read that in VEX.
Example attribute value: 
[ (0.365639, 0.0, 0.0), (0.0526581, 0.0, 0.0) ]
I can't find anything about arrays of tuples in the documentation, so I've tried the C style 2D array syntax
[0][0]
and treating the array of tuples as an array of vectors
[0].x, [0].y and [0].z
... none of which actually returned the results I was expecting. Currently I'm using a python node as a workaround, since that one can deal with tuples properly, but I'd like to keep my project VEX only, so I'd kindly ask if anyone knows how to read such arrays properly.
Edited by lpo7 - Jan. 3, 2023 05:32:09
User Avatar
Member
2658 posts
Joined: June 2008
Offline
Something like this works for me. I don't see tuples, I see an array of vectors.
v@uv_p = v[]@sourceprimuv[0];
In your example, the above code would fetch (0.365639, 0.0, 0.0) into a vector.
Edited by Enivob - Jan. 3, 2023 11:53:19
Using Houdini Indie 20.5
Windows 11 64GB Ryzen 16 core.
nVidia 3060RTX 12BG RAM.
User Avatar
Member
8 posts
Joined: June 2022
Offline
Interesting, thanks. I thought I tried that, but apparently I messed something up, probably with explicit type casts to an array. I've tried it again and now the following does successfully retrieve the U value I want.
f@curveu = v[]@curveuv[1].x;

Thank you!
  • Quick Links