Is there a vex command to execute a string variable?
Something like the exec() command in python.
Is there a vex command to execute a string variable?
1513 4 1- ylindqui
- Member
- 14 posts
- Joined: Jan. 2009
- Offline
- Jonathan de Blok
- Member
- 274 posts
- Joined: July 2013
- Offline
- ylindqui
- Member
- 14 posts
- Joined: Jan. 2009
- Offline
- Jonathan de Blok
- Member
- 274 posts
- Joined: July 2013
- Offline
ylindqui
Thanks for the response.
hmmm...I tried the following line in a attributeWrangle lop but no dice. Am I missing something?
string code = "usd_setvisibility(0, @primpath, 0);";
`code`;
See screenshot, you make your to-be-executed string in a string parm and have a backtick-ed hscript expression insert it into the code. Instead of parms you can also pull a string/value out of a attribute or whatever, as long as you do it with an expression.
Anyways, Houdini will first run the expressions, after that the vex code that is then executed will internally looks like this:
printf("vex says: Hello\n");
f@someAttrib=0.35 * @ptnum;
Edited by Jonathan de Blok - March 21, 2023 04:10:43
More code, less clicks.
- ylindqui
- Member
- 14 posts
- Joined: Jan. 2009
- Offline
-
- Quick Links