cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OpenMaya numeric array types should use the python Buffer protocol

OpenMaya numeric array types should use the python Buffer protocol

The Python buffer protocol allows for fast reading/writing of underlying numeric data. If we try to convert, say, a skin weight array into something that python (or more importantly numpy) can understand, for a moderately sized model, that takes 17 seconds of just copying data, and that. just. sucks.

 

And It could be as simple as adding a .toBuffer() or .toBytes() method on any numeric OpenMaya.M*Array objects. They could return a copy of the data as a flattened (for MPoint/MVector/MQuaternion/etc) array.array or bytestring object. Then it's easy to re-interpret that data as whatever we need.

 

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea