Performance issues procedurally painting vertex colors in Viewport 2.0

Posting here to see if anyone else has seen this issue before. I’m currently using Python and OpenMaya.api to procedurally paint vertex colors using mfnMesh.setFaceVertexColors(). If I run the code while using the Legacy Default viewport, my code runs without any hangs / wait times. However, if I run the same code using Viewport 2.0, I get a long hang specifically at the point when setFaceVertexColors() is called.

Oddly enough, if I delete all the other geometry in the scene, and run the code, it performs well using viewport 2.0, even though I’m not querying any information outside of the selected object.

My best estimation is that this call seems more expensive somehow with viewport 2.0 turned on AND more geometry in the scene, where the legacy viewport doesn’t have this issue even with lots of other geometry in the file.

Anyone else experience this and could shed some light on whats going on? Happy to share my script if that helps.

Currently using Maya2016 SP6.

Thanks in advance!

For others that might run into this as well : the problem was associated with the materials reloading after using setFaceVertexColors(). You can see the number of loading materials if you turn on Display --> Heads Up Display --> Material Loading Details. To prevent the hang from happening, set Material Loading Mode to be parallel in the display preferences.

I’m not currently using a version of maya that supports pausing material updates, but I’m curious if anyone could tell me if this would be worthwhile to use for what I’m trying to do. If you pause material loading updates, will you see the vertex colors update for the given object?