Jump to content
davidyannick

Vex create group

Recommended Posts

I wrote these lines to create a group frm my selection

Quote

int pointNum=chi("Ppointnum");
setpointattrib(geoself(),"Cd",pointNum,{0,1,0},"set");

int neighs[]=neighbours(0,pointNum);
for(int i=0;i<len(neighs);i++){
    setpointattrib(geoself(),"Cd",neighs,{1,0,0},"set");
    setpointgroup(0,"truc",neighs,1,"set");
}

 BBut the selection is ok but no group is created ??  I add a group sop and  the group "truc" is not listed ?

Can you help me please ? Thx

Capture d’écran 2019-01-17 à 23.13.07.png

untitled.hipnc

Capture d’écran 2019-01-17 à 23.15.05.png

Edited by davidyannick

Share this post


Link to post
Share on other sites

your pasted code snipped is broken (missing  [] when calling member from neighs array ), but the code in the screenshot is ok, and in the viewport it looks like it works

 

so I assume your problem is that your Group SOP is set to Primitives instead of Points and that's why you don't see the group in the menu

same in the viewport, you probably have Prim selection instead of point selection

also you can MMB on the node to see if your group is created and how many points it has

Edited by anim

Share this post


Link to post
Share on other sites

The group "truc" exists. MMB click on a wrangle node to see node details. Or check the Geometry Spreadsheet.
group_01.thumb.PNG.f45b52205d5c9b3b3d7f874e0af1bb1f.PNG

Share this post


Link to post
Share on other sites

ok thanks for your help you're both right :) 

Edited by davidyannick
add

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

×