I'm trying to get edges when subdivision modifier is active.
Using depsgraph
method gives the result as if the modifier had already been applied.
import bpy, bmesh
def get_mesh(obj):
context = bpy.context
depsgraph = context.view_layer.depsgraph
object = obj.evaluated_get(depsgraph)
mesh = object.to_mesh(preserve_all_data_layers=True, depsgraph=depsgraph)
return mesh
obj = bpy.context.active_object
me = get_mesh(obj)
bm = bmesh.new()
bm.from_mesh(me)
edges = [e for e in bm.edges]
bm.free()
I want to get this:
but I get these coordinates: