monomind 2 Posted February 21 Is there any way to get the number of primitives in a group? I've been trying to figure out. Share this post Link to post Share on other sites
anim 1,195 Posted February 22 In VEX: nprimitivesgroup() In Hscript: nprimsgroup() Share this post Link to post Share on other sites
monomind 2 Posted February 22 oh my bad! Trying to get number of pieces in a group - where each piece is multiple primitives. (voronoi pieces) Share this post Link to post Share on other sites
anim 1,195 Posted February 22 there is no guarantee that the group contains all the primitives of the piece, but to check how many unique different piece attribute values are there in the geo you can use nuniqueval() so delete all geo except for your group and call this function on resulting geo If however you are certain that all the prims of each piece are either in or not in the group you can use Pack SOP to pack pieces based on your piece attribute and transfer the group, then just count prims within that group as per first post Share this post Link to post Share on other sites
ftaswin 17 Posted February 22 // in detail wrangle : int prims[] = expandprimgroup(0,"primgroupname"); string pieces[] = {}; foreach(int p;prims) { string nm = prim(0,"name",p); if(find(pieces, nm) < 0) { append(pieces, nm); } } s[]@nm = pieces; Share this post Link to post Share on other sites