vex: how to use a channel string to decide the name of a group?

   3085   5   1
User Avatar
Member
1179 posts
Joined: April 2017
Offline
Hi!

I know I can use chs so the user can type in a word:

string name = chs("name");

…but I don't get how to use that string to decide the name of a group.

i@group_name; …..??

-Olivier
User Avatar
Member
406 posts
Joined: April 2017
Offline
You can mix in a bit of expression language to make this work:

@group_`chs("group_name")` = 1;
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
User Avatar
Member
1179 posts
Joined: April 2017
Offline
Oh,

How did you make the symbol right before chs and after )? I can't figure out the keyboard shortcut for that…

-Olivier
User Avatar
Member
9387 posts
Joined: July 2007
Offline
you can also use group binding in Bindings tab to define which group is bound to which variable in the wrangle
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
406 posts
Joined: April 2017
Offline
olivierth
Oh,

How did you make the symbol right before chs and after )? I can't figure out the keyboard shortcut for that…

-Olivier

It's the same key as ~ on a US keyboard layout… not sure what you're using. It forces an expression within to evaluate as a string.
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
User Avatar
Member
1179 posts
Joined: April 2017
Offline
Ah!

Thanks!

-Olivier
  • Quick Links