bmesh update in handler

Hi,

I’m trying to update a mesh in a bpy.app.handlers.scene_update_post() but it seem to fail to update it.

Here is a sinple exemple (not tested, it’s just to explain the process) :

def bm_update(scene):
___ob = bpy.data.objects[‘ob’]
___result = bpy.data.objects[‘result’]

___bm = bmesh.new()
___bmesh.from_object(ob.data, scene)

___bm.to_mesh(result.data)
___result.data.update()

bpy.app.handlers.scene_update_post.append(bm_update)

The function bm_update() works great when called one time (run script)
It works to in the handler but doesn’t update the mesh correctly (have to toggle edit/object mode to redraw it correctly)

Any idea on what i am doing wrong?

Thanks a lot!!

Looks like it’s not supported, but well, it doesn’t seem to be a good idea in the first place. Maybe delete the entire mesh every time and create a new one?

thank you CoDEmanX for your suggestion.
Adding/deleting object each frame sounds a bit huge for my need… Is there another way to do it? (maybe using the “traditionnal” mesh api?