attributes mix using VEX
2931
2
0
tosiho19
Member
46 posts
Joined: Oct. 2019
Offline
April 28, 2020 12:11 a.m.
Hi,
I am wondering how to mix two attributes with VEX. See attached a screen capture when I try to mix color attributes.
for some reason I can't get the value of the second wrangle input.
vector vA = v@opinput1_Cd ;
vector vB = v@opinput2_Cd ;
@vA = vA ;
@vB = vB ;
@Cd = (vA +vB )/2 ;
Attachments:
200428_Capture_Attribute mix with vex.PNG (616.9 KB)
tamte
Member
9239 posts
Joined: July 2007
Online
April 28, 2020 12:17 a.m.
input numbering starts form 0:
vector vA = v@opinput0_Cd ; // or just v@Cd
vector vB = v@opinput1_Cd ;
@Cd = ( vA + vB )/2 ;
you can also use lerp() to blend them in any ratio:
v@Cd = lerp (v@Cd , v@opinput1_Cd , 0.5 );
Tomas Slancik CG Supervisor Framestore, NY
tosiho19
Member
46 posts
Joined: Oct. 2019
Offline
April 28, 2020 9:47 a.m.
Thanks!