[Bf-python] Bmesh don't refresh the mesh in edit mode?

Campbell Barton ideasman42 at gmail.com
Mon Feb 27 01:44:43 CET 2012


The issue is that python doesn't have notifier access yet, so you cant
easily tell all 3D views to redraw from the console.
(though it wouldnt be hard to write a python function to do so.)

if you run a tool from the 3D view you can redraw the active view.
context.area.tag_redraw()

If you have a modifier applied, rna can refresh this via the object.
obj.update_tag(refresh={'DATA'})

There are still some TODO's - how to tell the editmeshes ngons to be
re-tesselated, how to sync between the bmesh and the original mesh and
updating as you noticed.

On Mon, Feb 27, 2012 at 4:55 AM, ValterVB <valtervb at live.com> wrote:
> Try this in Edit mode:
>
> import bpy, bmesh
> obj = bpy.context.object
> mesh = obj.data
> bm = bmesh.from_mesh(mesh)
>
> bm.verts[0].co.x +=  1
>
> To see the modified mesh I must to go to in Object mode.
> if I want a "real time" update of the mesh what I must doing?
>
> Thanks
> Valter
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python



-- 
- Campbell



More information about the Bf-python mailing list