How to access individual values of a vector attribute in VEX

   2853   5   1
User Avatar
Member
8 posts
Joined: 11月 2021
Offline
Hi guys!

I am using a resample node and letting it create the Tangent Attribute. It works fine but I cannot figure out how to then access the individual values of that attribute in an Attribute Wrangle node.

I have tried @tangentu.0 @tangentu @tangentu{0} @tangentu.x @tangentu.r but nothing works, I always get an error saying that the attribute is a float and not a vector.

Any ideas? Thanks!

Image Not Found

Image Not Found

Attachments:
img03.jpg (243.6 KB)

User Avatar
Member
136 posts
Joined: 3月 2016
Offline
try using @tangentu.x rather than .0
and maybe try v@tangentu.x to be very explicit its a vector.
Love Houdini
User Avatar
Member
4616 posts
Joined: 2月 2012
Offline
Hi,

tangentu is not one of the known attributes so you have to explicitly specify the type unless if it's float as @Hatchery mentioned v@tangentu.

Then you can use
.x
or
[0]
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
900 posts
Joined: 2月 2016
Offline
I rmb this issue was driving me crazy when working with user-created vector attributes in Vex.

Now I developed the habit of always specify the data type when reading any attrib.
Just in case.
User Avatar
Member
8 posts
Joined: 11月 2021
Offline
Hatchery
try using @tangentu.x rather than .0
and maybe try v@tangentu.x to be very explicit its a vector.

Thanks that worked!

I was also able to get it done by using the attrib() function



But I see that using v@tangentu.x is essentially the same thing but more efficient.

Thanks a lot for the help!

Attachments:
Capture.JPG (37.1 KB)

User Avatar
Member
8 posts
Joined: 11月 2021
Offline
Andr
I rmb this issue was driving me crazy when working with user-created vector attributes in Vex.

Now I developed the habit of always specify the data type when reading any attrib.
Just in case.

yeah I will make sure to make a habit of it too! thanks for the tip!
  • Quick Links