Simple question about uv components and vex

   2482   4   0
User Avatar
Member
115 posts
Joined: Feb. 2014
Offline
Hi there,

I have two uv sets uv and uv2 (points), i want to access the individual components of uv2 in a wrangle. The wrangle will see uv.x but won't see uv2.x. Both uv attributes are applied in the same manner and are both uv 3flt(Tex). I thought perhaps it should be uv.0 as this is how it's listed in the geo spreadsheet but no dice. Invalid subscript for type: float.x (1,8:9) is the main error message I get from the node info but it means less than it should to me currently.

any clues you can throw me please?


cheers,

A>
User Avatar
Member
8555 posts
Joined: July 2007
Offline
you need o specify that it is a vector
so you need to do:
v@uv2.x

otherwise Houdini will think it is a float
this is not ecessary for certain common attributes known to Houdini like P, N, Cd, uv, orient... but for custom ones you have to specify
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
115 posts
Joined: Feb. 2014
Offline
Tomas to the rescue yet again. Thank you.

A.
User Avatar
Member
18 posts
Joined: Aug. 2018
Offline
If I do v@uv2 = @uv, it does copy the values but doesn't show ( say in unreal engine). Also, in the inspector popup, it says uv(Tex) but not uv2(Tex).
Edited by FJSam - Oct. 29, 2021 12:42:09

Attachments:
Screenshot_1.jpg (12.7 KB)

User Avatar
Member
8555 posts
Joined: July 2007
Offline
only uv attribute has the type info automatically set as texturecoord by default
uv2, uv3, ... are just arbitrary attribute names that Houdini doesn't make any assumption about so it will not assume they are texturecoord, color, normal, ... when you are creating them and will leave them without any specific type info

- you can replace this v@uv2 = @uv;by Attribute Swap SOP in Copy mode, corresponding Class and set Type Info to Copy Source

- or if you want to create it in wrangle using the code above for example then you can set the type info directly in wrangle
v@uv2 = ...;
setattribtypeinfo(0, "vertex", "uv2", "texturecoord");
assuming it is Vertex attribute in this case

- you can also use Attribute Create SOP to set the Type Info to Texture Coordinate
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links