Jump to content
Sign in to follow this  
JDee

Connected neighbours for points in group

Recommended Posts

Hi

What I need is to find connected neighbors of every point of specific group.
I guess that I need one loop inside of other loop in VOP, is it right way at all? so the firs one is for all the points I have in the group and then second one for all the neighbors for them? I feel like it's not so easy, with my knowledge of VEX.
Is there more simple way, and how to specify group point numbers properly from outside VOP, so I don't need to set them manually in VOP every time ?
Much appreciated any help.

NFG.hipnc

Share this post


Link to post
Share on other sites

a VEX solution

int ls [] = array();

if (inpointgroup(0, "in", @ptnum)) {
    ls = neighbours(0, @ptnum);
    for (int i=0; i<len(ls); i++) {
        setpointgroup(0, "neighbours", ls[i], 1);
        setpointattrib(0, "Cd", ls[i], {1,0,0});
    }
}

 

  • Like 1

Share this post


Link to post
Share on other sites
45 minutes ago, iamyog said:

a VEX solution

It works perfectly thank you!
Also found simplest solution for me with Group by edge depth, set it in 2 klicks, so it's actually grows your selection... yeah It's houdini.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×