Jump to content

manipulating vex group name?


Recommended Posts

How do I manipulate a group name? Here I'm onto grouping the corresponding points of similar mehes, so that I can then connect them.

I got it working but not for any situation, here it works for a cube with 8 points

int grpnum = @ptnum % 8;
@group_grp_0 = (grpnum == 0);
@group_grp_1 = (grpnum == 1);
@group_grp_2 = (grpnum == 2);
@group_grp_3 = (grpnum == 3);
@group_grp_4 = (grpnum == 4);
@group_grp_5 = (grpnum == 5);
@group_grp_6 = (grpnum == 6);
@group_grp_7 = (grpnum == 7);

So, I'm trying to do a version without explicit lines, just a loop for n points, not just 8.

 

int psize = 8;

int grpnum = @ptnum % psize;

for (int i = 0; i < psize; i++) {
@group_grp_i = (grpnum == i);
}

Where it says @group_grp_i, I would like 'i' to be the iteration value. As is, it just makes it all named grp_i, not grp_0, grp_1, grp_2.... etc.

J6u4znd.png

Thanks!

 

GroupSamePoints.hipnc

Edited by probiner
Link to comment
Share on other sites

no idea what I am doing, clutching at straws...I changed the for loop to

for (int i = 0; i < psize; i++) {
s@grp = sprintf("%s%d","grp_",grpnum);
}

results:

grp
===
grp_0
grp_1
grp_2

etc....etc...

Nah...pls ignore..I'm yet to fully understand the problem..

Edited by Noobini
Link to comment
Share on other sites

Thanks, that led me to the answer:

int psize = 8;
int grpnum = @ptnum % psize;
setpointgroup(0, sprintf("%s%d","grp_",grpnum), @ptnum, 1);

setpointgroup seems to be way to go!

Cheers

Edited by probiner
  • Like 1
Link to comment
Share on other sites

32 minutes ago, probiner said:

Thanks, that led me to the answer:


int psize = 8;
int grpnum = @ptnum % psize;
setpointgroup(0, sprintf("%s%d","grp_",grpnum), @ptnum, 1);

setpointgroup seems to be way to go!

Cheers

I learnt from this too...thanks

Link to comment
Share on other sites

Just having a hard time to imoport the @numpt of another mesh. Doesn't seem to be a point attribute.  
I would like to have

int psize = 8;

with something like:
 

int psize point(1, "numpt", 0);

Where 1 a second input.

Below my attempt to get numpt from another mesh in VOPs. Always retuns 0. I expected 4. Dunno...



AYgQmtr.png

Edited by probiner
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...