Python Loop Perfomance Question & C++ MPxCommand Question

25 views
Skip to first unread message
is duplicateview conversation

daeseok chae

unread,
Sep 23, 2022, 2:20:55 AM9/23/22
to Python Programming for Autodesk Maya
Hello,

I am writing a script that extracts a Point located in a mesh using anyIntersection of MFnMesh.

However, there are too many points, so the performance does not come out while looping.

So I'm trying to find another way, but it's not easy to find example code.
Here's the method I've tried:

1. I tried to work the Python Loop part with C++ MPxCommand, but I couldn't find a way to return data by executing the Arguments in the form of Float3Array (Point Positions) and the corresponding command. (Return : IntArray)
2. It is said that the part can be written in C++ using PyBind, but I know that the For Loop speed is limited due to the same GIL issue. Is there any way to solve it??
3. It seems that there is no way to increase the speed of the current Python Loop by raising the speed of the loop as much as possible.

Loop Count : 1,000,0000 Under
anyIntersection: 4 Direction (Up, Left, Right, Down)

thank you
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages