Jump to content

[SOLVED]Group name to string


Recommended Posts

Hi.

How could I convert primitive group name to a string attribute?

I have few groups - group _01/02/03/.... and I just want to get numbers to use them as integers in vex, just to apply random color.

int group_number = opdigits(@name);

@Cd = set(rand(group_number), rand(group_number*1502), rand(group_number/1560));

Doing it with the name SOP, but what is the way of doing that in vex?

Thank you

Cheers

Janis

Link to comment
Share on other sites

20 hours ago, anim said:

some info about this can be found here

 

Thanks a lot.

this is what I used at the end.

string primgrps[] = detailintrinsic(0, "primitivegroups");
s[]@primingrps = {};

foreach(string grp;primgrps){
    if (inprimgroup(0, grp, @primnum)) append(s[]@primingrps, grp);
}

int group_number = opdigits(s@primingrps[0]);
@Cd = set(rand(group_number), rand(group_number*1502), rand(group_number/1560));

Link to comment
Share on other sites

  • cudarsjanis changed the title to [SOLVED]Group name to string

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...