I'm looking for a way to automatically invoke a custom Python script upon (manually) moving one or more vertices in a mesh (in the 3D Viewport or in the UV Editor). I've come across a couple of options while doing some searches with keywords including callback, listener and handler (see below), though I'm not yet sure how to approach it efficiently.
One option would be to make the triggering event less specific, e.g. invoking the Python script every time the 3D view is updated. In that case, bpy.types.SpaceView3D.draw_handler_add might be the way to go, though it does not sound optimal.
Alternatively, there is the relatively new msgbus, though on https://docs.blender.org/api/2.83/bpy.msgbus.html the following is mentioned:
The following updates do not trigger message bus notifications:
- Moving objects in the 3D Viewport.
This seems to rule out using msgbus for my purposes. Any other suggestions on how to approach this?