anicg Posted March 30, 2020 Share Posted March 30, 2020 I'm trying to turn this into a for loop in Vex, for each point attribute: Step 1: to take all the points that have >0 and group them, name of the group is the name of the point attribute. if(@pointattribute1 > 0) @group_pointattribute1 = 1; if(@pointattribute2 > 0) @group_pointattribute2 = 1; if(@pointattribute3 > 0) @group_pointattribute3 = 1; ... Step 2: Promote each of these created point groups to primitive groups Quote Link to comment Share on other sites More sharing options...
anim Posted March 30, 2020 Share Posted March 30, 2020 string ptattribs[] = detailintrinsic(0, "pointattributes"); foreach (string ptattrib; ptattribs){ int size = pointattribsize(0, ptattrib); int type = pointattribtype(0, ptattrib); if (size == 1 && type < 2){ float value = point(0, ptattrib, @ptnum); if (value > 0){ setpointgroup(0, ptattrib, @ptnum, 1); } } } or if you want to be able to specify which attributes : string attribmask = chs("attribmask"); string ptattribs[] = detailintrinsic(0, "pointattributes"); foreach (string ptattrib; ptattribs){ if (match(attribmask, ptattrib) ){ int size = pointattribsize(0, ptattrib); int type = pointattribtype(0, ptattrib); if (size == 1 && type < 2){ float value = point(0, ptattrib, @ptnum); if (value > 0){ setpointgroup(0, ptattrib, @ptnum, 1); } } } } 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.