pelos Posted January 14, 2019 Share Posted January 14, 2019 I can use npoints("../sop") but that count ALL the points, is there a way to just count the points on the first primitive? Quote Link to comment Share on other sites More sharing options...
anim Posted January 15, 2019 Share Posted January 15, 2019 in VEX you can use primvertexcount() https://www.sidefx.com/docs/houdini/vex/functions/primvertexcount.html Quote Link to comment Share on other sites More sharing options...
pelos Posted January 15, 2019 Author Share Posted January 15, 2019 interesting I am running it on a series of curves/hairs and I just get 1 as result, my hairs have 10 points each, vertex are been consider different as points in this case? Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted January 15, 2019 Share Posted January 15, 2019 int primpts[] = primpoints(0,@primnum); i@pointcount = len(primpts); Will also work. In a curve each point will have one vertex, so they the count will match. Quote Link to comment Share on other sites More sharing options...
anim Posted January 15, 2019 Share Posted January 15, 2019 14 minutes ago, pelos said: interesting I am running it on a series of curves/hairs and I just get 1 as result, my hairs have 10 points each, vertex are been consider different as points in this case? running it how? run over Primitives: i@n = primvertexcount(0, @primnum); should return correct number for you per primitive it's true that it will return number of vertices and not points, and those can differ based on type of the curve and how they are constructed, but for most common polygonal curve primitives they usually match 1 Quote Link to comment Share on other sites More sharing options...
pelos Posted January 18, 2019 Author Share Posted January 18, 2019 since I needed in a parameter I did python node = hou.pwd() geo = node.geometry() prim0 = geo.prim(0) return len(prim0.points()) 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.