teddy28 Posted September 25, 2015 Share Posted September 25, 2015 Hi everyone, I would like to get the group name from attribute "flag" > 0. Then set some attribute to the whole group's points. I set the point number 276's flag attribute to 1. And it should belongs to 3 groups(inactive,group_276,and pieceXX). I had searched for solution and some said it can be done by using pointgrouplist. But I have no idea how to use it for checking. Anyone can help? Many thanks! pointgroup_question.hip Quote Link to comment Share on other sites More sharing options...
Atom Posted September 25, 2015 Share Posted September 25, 2015 (edited) What about something like this in a Point Wrangle placed at the end of your network chain? The flag will be set to 1.0 if it is in the active group. int result = inpointgroup(0,"active",@ptnum); if (result) { setpointattrib(0,"flag",@ptnum,1.0,"set"); } There are other point based attribute functions you can leverage as well. https://www.sidefx.com/docs/houdini14.0/vex/functions/ Edited September 25, 2015 by Atom 1 Quote Link to comment Share on other sites More sharing options...
teddy28 Posted September 29, 2015 Author Share Posted September 29, 2015 (edited) What about something like this in a Point Wrangle placed at the end of your network chain? The flag will be set to 1.0 if it is in the active group. int result = inpointgroup(0,"active",@ptnum); if (result) { setpointattrib(0,"flag",@ptnum,1.0,"set"); } There are other point based attribute functions you can leverage as well. https://www.sidefx.com/docs/houdini14.0/vex/functions/ Thanks for reply. But what I want to do is if the points' attribute "flag" > 1 then set another attribute to 1 for the group "pieceXX" that the points belongs to. So I want to get what group that the point belongs to. Edited September 29, 2015 by teddy28 Quote Link to comment Share on other sites More sharing options...
anim Posted September 29, 2015 Share Posted September 29, 2015 ... So I want to get what group that the point belongs to. this will give you list of all point groups each point belongs to as string array attrib called ptingrps string ptgrps[] = detailintrinsic(0, "pointgroups"); s[]@ptingrps = {}; foreach(string grp;ptgrps) { if (inpointgroup(0, grp, @ptnum)) append(s[]@ptingrps, grp); } 7 1 Quote Link to comment Share on other sites More sharing options...
teddy28 Posted September 30, 2015 Author Share Posted September 30, 2015 (edited) this will give you list of all point groups each point belongs to as string array attrib called ptingrps string ptgrps[] = detailintrinsic(0, "pointgroups"); s[]@ptingrps = {}; foreach(string grp;ptgrps) { if (inpointgroup(0, grp, @ptnum)) append(s[]@ptingrps, grp); } Thanks! It works perfectly Edited September 30, 2015 by teddy28 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.