Maya MeshIntersector C++


#1

Hi all. I am using MMeshIntersector to get closest points in a custom deformer and in my opinion is quite slow in comparison with mfnmesh.getClosestIntersection using Accel structure. I would like to know if I am doing something wrong.

  1. Only creating the structure when mesh go dirty.
  2. Init Intersector with worldMesh mesh. Although the returning closest point is in object space I’m doing this way.
  3. No multithread
  4. Maya 2016

I am just trying to understand why it seems so slow if it is supposed to use and octree internally.

Thanks I advance


#2

Stop the guesswork and configure a profiler. Not sure if you have access to Maya’s debug symbols, but with those it’s really easy to see where the cycles go to. From my experience, looking at the code most of the time you’ll just make wrong assumptions which parts are actually slow.