abanoub Posted October 5, 2016 Share Posted October 5, 2016 Hi,,, I'm facing some troubles understanding some vex functions , many HIP files include wrangles like int vt0 = vertexindex(0,@primnum,0); int vt1 = vertexindex(0,@primnum,1); int pt0 = vertexpoint(0,vt0); int pt1 = vertexpoint(0,vt1); and I don't understand what the two functions return exactly ? Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted October 5, 2016 Share Posted October 5, 2016 vertexindex returns a unique number for every vertex on your mesh. while vertexpoint tells you what point is connected to your vertex. vertexindex.hipnc 1 Quote Link to comment Share on other sites More sharing options...
acey195 Posted October 6, 2016 Share Posted October 6, 2016 pointvertex() will also give you the (usually first) vertex connected to a point (returns -1 if it is an isolated point). you could then use vertexnext() and vertexprev() to get more vertices connected to the same point. pointvertices() will give you an int array of all the vertices connected to a point. I generally always have this open when writing vex: https://www.sidefx.com/docs/houdini15.0/vex/functions/ the simple way to remember how these guys work, is the [first part of the name is the input] [second part of the name is the output] 1 Quote Link to comment Share on other sites More sharing options...
abanoub Posted October 8, 2016 Author Share Posted October 8, 2016 Thankx Konstantin Quote Link to comment Share on other sites More sharing options...
abanoub Posted October 8, 2016 Author Share Posted October 8, 2016 Thankx Twan , but sometimes docs don't give a good explanation of vex functions . Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted October 8, 2016 Share Posted October 8, 2016 Youre totally right abanoub. The help documents should explain contexts more often. A good way to find out what functions are doing is testing them in a simple, self-made scene, though. Just check how the attributes change in your geometry spreadsheet. 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.