I would like to check mesh for any modifications in Scripting API in mesh topology, such as adding or deleting vertices/faces. Is there a callback or function that works for this purpose?


1 Answer 1


Yes, you can use Depsgraph and handlers (depsgraph_update_post/pre) for that. For example,

import bpy

def mesh_change_listener(scene, depsgraph):
    # check if we need to iterate through updates at all
    if not depsgraph.id_type_updated('MESH'):

    for update in depsgraph.updates:
        if isinstance(update.id, bpy.types.Mesh):
            print('Mesh \"{}\" updated.'.format(update.id.name))

if __name__ == '__main__':
  • $\begingroup$ But if we subscribe to bpy.types.Object with msgbus, how do we retrieve the knowledge which object exactly got updated? $\endgroup$
    – D. Skarn
    May 9, 2020 at 10:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .