probiner Posted June 13, 2017 Share Posted June 13, 2017 (edited) 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. Thanks! GroupSamePoints.hipnc Edited June 13, 2017 by probiner Quote Link to comment Share on other sites More sharing options...
Noobini Posted June 13, 2017 Share Posted June 13, 2017 (edited) 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 June 13, 2017 by Noobini Quote Link to comment Share on other sites More sharing options...
probiner Posted June 13, 2017 Author Share Posted June 13, 2017 (edited) 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 June 13, 2017 by probiner 1 Quote Link to comment Share on other sites More sharing options...
Noobini Posted June 13, 2017 Share Posted June 13, 2017 I'm back to annoy ppl...:) whatabout Partition, rule is: grp_`@ptnum%8` 1 Quote Link to comment Share on other sites More sharing options...
Noobini Posted June 13, 2017 Share Posted June 13, 2017 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 Quote Link to comment Share on other sites More sharing options...
probiner Posted June 13, 2017 Author Share Posted June 13, 2017 (edited) 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... Edited June 13, 2017 by probiner Quote Link to comment Share on other sites More sharing options...
adrianr Posted June 13, 2017 Share Posted June 13, 2017 (edited) i@psize = npoints(1); should work Edit: Sorry if you want it in vops I guess an inline vop with $psize = npoints(1); Edited June 13, 2017 by adrianr 1 Quote Link to comment Share on other sites More sharing options...
probiner Posted June 13, 2017 Author Share Posted June 13, 2017 (edited) Thanks adrianr. I'm done! CurveInterpolation_web.hipnc Edited June 13, 2017 by probiner 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.