Warning: don't return OpenMaya objects in python


#1

A short synopsis:
From my main(), I’m calling a function to get mesh points. The function returned a list of maya.api.OpenMaya.MPoint.
From the main, I, e.g., calculated the bounding box of the points. Half of the time, the bbox kept changing. I realized that the memory got partially reset.

What resolved that: I returned a list of doubles (of the point coordinates) instead, and I constructed a new MPoint before using MBoundingBox.

I’m using Maya 2019.

I wasted hours on this; Maya is shit!