Jump to content

Setting attributes using VEX


victorrijo

Recommended Posts

Hi everyone,

I'm trying to give a value to an attribute of a line connected to an attribute vop sop. I know I can give a value to the global variables like P, N, Cd etc. but what if I want to give a value to something like the direction of the line ( dirx, diry, dirz ) using vex. I can access these attributes easily using ch() but setting the values is not as simple as dirx = 1;

Link to comment
Share on other sites

To set a float attribute in a wrangle node you can write

f@dir = 1;

To set a vector attribute you can do

v@dir = {1,2,3};//note curly brackets

or else if you want to set it to some sort of variable you need to use the set() function - 

v@dir = set(@ptnum, @N.y, 0);

Link to comment
Share on other sites

I think Victor may be asking about channels, not attributes, which VEX can not do at this time as of H15. So he is not looking to set an attribute on the data of the node but instead set a value on one of the parameter channels of the node.

Link to comment
Share on other sites

On 5/1/2016 at 0:54 PM, j00ey said:

To set a float attribute in a wrangle node you can write

f@dir = 1;

To set a vector attribute you can do

v@dir = {1,2,3};//note curly brackets

or else if you want to set it to some sort of variable you need to use the set() function - 

v@dir = set(@ptnum, @N.y, 0);

 

Hey @j00ey, thanks for responding and I'm sorry if my post was confusion but yes, @Atom is completely right.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...