Omy Posted December 23, 2011 Share Posted December 23, 2011 I have a grid.I want to find the number of polygons points and prims in the grid.could anyone share a code snippet.thnks Quote Link to comment Share on other sites More sharing options...
3dbeing Posted December 23, 2011 Share Posted December 23, 2011 (edited) I have a grid.I want to find the number of polygons points and prims in the grid.could anyone share a code snippet.thnks geo = hou.node().geometry() npts = len(geo.points()) npr = len(geo.prims()) print npts print npr not sure what you mean by polys as a poly is a prim, unles its a mesh. Edited December 23, 2011 by 3dbeing Quote Link to comment Share on other sites More sharing options...
Omy Posted December 23, 2011 Author Share Posted December 23, 2011 geo = hou.node().geometry() npts = len(geo.points()) npr = len(geo.prims()) print npts print npr not sure what you mean by polys as a poly is a prim, unles its a mesh. coool can we also find uv cordinates and the number of vertices Quote Link to comment Share on other sites More sharing options...
3dbeing Posted December 23, 2011 Share Posted December 23, 2011 (edited) coool can we also find uv cordinates and the number of vertices Yes! test =0 for x in geo.prims(): test = test+x.numVerticies() print test also this brought up the realisation that prims is a rather generic term. Perhaps you were referring to faces earlier? Prim Type I found this one interesting hou.primType.Mataball (sp?) as for uv's i think this is what you're after, but hmmmm http://www.sidefx.com/docs/houdini11.1/hom/hou/Surface#vertex Edited December 23, 2011 by 3dbeing Quote Link to comment Share on other sites More sharing options...
3dbeing Posted December 23, 2011 Share Posted December 23, 2011 (edited) sorted.... wow the more i use python the more amazing it gets.. the level of control is unprecedented!!! attr = geo.findVertexAttrib('uv') for x in geo.prims(): for y in x.verticies() print y.attribValue(attr) Edited December 23, 2011 by 3dbeing 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.