VEX assign components error

   1032   2   0
User Avatar
Member
948 posts
Joined: April 2008
Offline
If i have two vector vertex or point attributes like @uv and @uv_2 and try in vex:

@uv.x=@uv_2.y;

I got an error, even if I do like:

vector u = @uv_2.x;

I also got an error so if I try like:

vector u = @uv_2;
@uv.x=u.y;

Then it works but if I try like:

@Cd.y=@P.y;

It also works! For some reason I can't assign directly components for some attributes, what am I missing?
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
7762 posts
Joined: Sept. 2011
Online
@foo binds to floats, except for some special cases like ‘Cd’ and ‘uv’

Since ‘uv_2’ is not a special case, it's bound as a float, and floats don't have components.

either prototype it first:

vector @uv_2 = {0,0,0};

or use v@uv_2to bind as a vector
Edited by jsmack - July 28, 2020 20:03:08
User Avatar
Member
948 posts
Joined: April 2008
Offline
Ok it makes sense, thanks for the explanation!
https://vimeo.com/user2163076 [vimeo.com]
  • Quick Links