ryreh Posted May 6, 2017 Share Posted May 6, 2017 Hello! In Attribute Wrangle I did: vector x = {1,2,3}; int i = 1; vector y = set(x1); // this makes @y={1,2,3} Can I did it in other way to get the same result?: vector y = set(x); // here x should became x1 Quote Link to comment Share on other sites More sharing options...
Atom Posted May 6, 2017 Share Posted May 6, 2017 (edited) set() is how you populate a vector variable. It requires 3 values. You don't use set() to set one variable equal to another, just use the equals symbol = // braces are used only for constants and can not support variables. vector v = {1,2,3}; // set() is used for constant or variable style vector construction. float x = 1.0; float y = 2.0; vector v = set(x,y,3.0); // equals is for assignment. x = y; vector v = set(x,x,x); Edited May 6, 2017 by Atom Quote Link to comment Share on other sites More sharing options...
ryreh Posted May 6, 2017 Author Share Posted May 6, 2017 40 minutes ago, Atom said: set() is how you populate a vector variable. It requires 3 values. You don't use set() to set one variable equal to another, just use the equals symbol = // braces are used only for constants and can not support variables. vector v = {1,2,3}; // set() is used for constant or variable style vector construction. float x = 1.0; float y = 2.0; vector v = set(x,y,3.0); // equals is for assignment. x = y; vector v = set(x,x,x); I badly explained what I want,sory( Here is what I meant: I have vectors variable which have numbers in theirs names (x1,x2,x3 etc). And I have an integer variable/variables (i = 1,2,3 etc.). So my goal is to call the vector variable in a loop: for (int i =1; i<4; i++){ vector y = set(x`i`) - here I want Houdini commits this expression like "set(x1)" and value of x1 should assained to y. Quote Link to comment Share on other sites More sharing options...
Atom Posted May 6, 2017 Share Posted May 6, 2017 (edited) No need for any of that then. vector x1 = set(1,2,3); vector y = x1; I don't think you can construct a variable name as a string and then operate upon it as if it was a variable. You may want to review the VEX language syntax and functions. Edited May 6, 2017 by Atom 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.