attributes mix using VEX

   2931   2   0
User Avatar
Member
46 posts
Joined: Oct. 2019
Offline
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)

User Avatar
Member
9239 posts
Joined: July 2007
Online
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
User Avatar
Member
46 posts
Joined: Oct. 2019
Offline
Thanks!
  • Quick Links