--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/dccecf9e-b015-487a-99e0-2581af29ff98n%40googlegroups.com.
Ok, I’m missing a lot of information haha. Let me try and fill in some gaps.
Here’s finding edges for 1 vertex amongst 100,000 vertices.
plane, _ = cmds.polyPlane(sx=1000, sy=100)
cmds.scale(10, 1, 10)
def measureMe():
vtx = plane + ".vtx[10]"
cmds.polyListComponentConversion(vtx, fromVertex=True, toEdge=True)
iterations = 100
result = timeit.timeit(measureMe, number=iterations)
resultMs = result * 1000
resultPerIteration = resultMs / iterations
print("%.2f ms/iteration" % resultPerIteration)
# 0.50 ms/iteration
It’s clocking in at half a millisecond. Now, is this what you mean by slow? What do you consider fast? What numbers are you hoping for?
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/cfbdb039-4f09-4f0a-8fa3-d4c934f3c2ddn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/dde82079-1103-4980-9442-5aa939563ad9n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAEKd6bZ3Y%2BxJwJnz-Sq3RJpreqVS7hL3g8pJvE%3DpHiN0uPT9Ag%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/107A3C11-F217-4525-A229-4565BC78D226%40gmail.com.