0
$\begingroup$

I have encountered weird situation with self-made addon where vertices are selected in Edit Mode after adding mesh. Is this to do with bmesh? Edit: Figured that one out, just selected all verts during verts editing

def simple_subdiv(mesh: bpy.types.Mesh, radius, level):
    i = 0
    bm = bmesh.new()
    bm.from_mesh(mesh)
    while i < level:
        bmesh.ops.subdivide_edges(bm, edges=bm.edges, use_grid_fill=True, cuts=1)
        j = 0
        verts = bm.verts
        verts.ensure_lookup_table()
        while j < len(verts):
            vert = verts[j].co
            vert.normalize()
            verts[j].co = vert * radius
            j = j + 1
        i = i + 1
    bm.to_mesh(mesh)

Edit Mode

$\endgroup$
  • 2
    $\begingroup$ Nothing to do with bmesh. Add mesh primitive operators select all geometry by default. Add bmesh primitives are unselected by default. Speculate that your image shows result of add cube primitive. New geo from bmesh is unselected if not formed from selected.blender.stackexchange.com/questions/178158/… $\endgroup$ – batFINGER May 30 at 17:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.