To avoid some unnecessary OBJECT/EDIT mode toggle, i'd like to be able to perform some actions via Bmesh in object mode. Is it possible to update apply changes after a Bmesh action in object mode ? For exemple, i try to select an edge with this little code but, without update, the edge not selected.
import bpy
import bmesh
C = bpy.context
ob = C.object
me = ob.data
bm = bmesh.new()
bm.from_mesh(me)
bm.edges.ensure_lookup_table()
bm.edges[2].select = True
# need to update here
bm.free()
del bm
bm.to_mesh( me )
, or as @jdk1.0 answered below, use thebmesh.from_edit_mesh( me )
method. Only after selecting, also runbm.select_flush( True )
. $\endgroup$