In Hython, the code I am using is this:
pointList = [[pt.number() for pt in pr.points()] for pr in geo.prims()]
I have been in touch with the engineering staff for SideFX about the performance issues and there is not much that can be done. The prim.points() function takes about 13 microseconds to run, which is several orders of magnitude larger than it would take to just load a list. Behind the scenes it is running over generators for hou.Prim.verticies() which then is resolved back to the points.
What I want to do is use VEX's primpoints(geo, primnum) function to get the list. A user over on Odforce did some tests and found that the process of aliasing the point numbers to a list of ints using the function is way better, but I cannot use a wrangle node in the project. No verbs for anything which would do what I need.
So this leads me to where I am now. hou.runVex(). This function takes a .vex file and a dictionary of values and spits out a dictionary with the results. I have gotten my vex code to compile (it's wrong though) and I have figured out how to get data to pass to it through the function. The issue is that I cannot figure out how to declare a variable as a geometry object to be handed over. I have the HOM objects (which are loaded from disk) which I would like to pass to the primpoints() as the 'file' attribute. This should be doable as it is able to be done in a wrangle node, but I cannot for the life of me figure out how.
vfl I have now:
cvex pointNumbers(int geo = 0, int primnum=0; export int pointList[]={}) { pointList = primpoints(geo, primnum); }
Python I want to be using:
pointList = [hou.runVex('pointNumbers.vex', {'geo':geo, 'primnum':pr.number()}) for pr in geo.prims()]
I am also using Pandas on the Python side, so it may be an option to hand the whole geometry and handle the calls inside VEX, hand out a list of point numbers and an index matched list of prim numbers, then using Pandas on the Python side to stack it all, but for now I just need the hou.runVex() function to actually process. The error I get comes from not being able to type the VEX geo variable in a way to accept the geo HOM object. What do I need to do to the object to pass it to the VEX variable?