Skip to main content
added 2 characters in body
Source Link
Gorgious
  • 31.6k
  • 2
  • 47
  • 104

In your example, the 4 corners wouldn't get selected because they are connected to 2 edges.

However there is a handy operator with SHIFT + G or Select>Select Similar then "Amount of connecting edges"

enter image description here

Alternatively, if used in a script, you can use the operator :

bpy.ops.mesh.select_similar(type='EDGE', threshold=0.01)

But you need to first select some vertices.

enter image description here

If you can't select the vertices before running your script, use this :

import bpy
import bmesh
    
mesh = bpy.context.object.data  # Get selected object's mesh

bm = bmesh.from_edit_mesh(mesh) 
# Create new edit mode bmesh to easily acces mesh data
    

for v in bm.verts:
    v.select = select_set(len(v.link_edges) in (2,3) )
# Select all vertices that have 2 or 3 links and deselect the others
    
bmesh.update_edit_mesh(mesh)  # Transfer the data back to the object's mesh

Source and Source 2

In your example, the 4 corners wouldn't get selected because they are connected to 2 edges.

However there is a handy operator with SHIFT + G or Select>Select Similar then "Amount of connecting edges"

enter image description here

Alternatively, if used in a script, you can use the operator :

bpy.ops.mesh.select_similar(type='EDGE', threshold=0.01)

But you need to first select some vertices.

enter image description here

If you can't select the vertices before running your script, use this :

import bpy
import bmesh
    
mesh = bpy.context.object.data  # Get selected object's mesh

bm = bmesh.from_edit_mesh(mesh) 
# Create new edit mode bmesh to easily acces mesh data
    

for v in bm.verts:
    v.select = len(v.link_edges) in (2,3) 
# Select all vertices that have 2 or 3 links and deselect the others
    
bmesh.update_edit_mesh(mesh)  # Transfer the data back to the object's mesh

Source and Source 2

In your example, the 4 corners wouldn't get selected because they are connected to 2 edges.

However there is a handy operator with SHIFT + G or Select>Select Similar then "Amount of connecting edges"

enter image description here

Alternatively, if used in a script, you can use the operator :

bpy.ops.mesh.select_similar(type='EDGE', threshold=0.01)

But you need to first select some vertices.

enter image description here

If you can't select the vertices before running your script, use this :

import bpy
import bmesh
    
mesh = bpy.context.object.data  # Get selected object's mesh

bm = bmesh.from_edit_mesh(mesh) 
# Create new edit mode bmesh to easily acces mesh data
    

for v in bm.verts:
    v.select_set(len(v.link_edges) in (2,3))
# Select all vertices that have 2 or 3 links and deselect the others
    
bmesh.update_edit_mesh(mesh)  # Transfer the data back to the object's mesh

Source and Source 2

Removed unnec. table lookup. Not indexing verts, edges of faces.
Source Link
batFINGER
  • 84.6k
  • 10
  • 110
  • 237

In your example, the 4 corners wouldn't get selected because they are connected to 2 edges.

However there is a handy operator with SHIFT + G or Select>Select Similar then "Amount of connecting edges"

enter image description here

Alternatively, if used in a script, you can use the operator :

bpy.ops.mesh.select_similar(type='EDGE', threshold=0.01)

But you need to first select some vertices.

enter image description here

If you can't select the vertices before running your script, use this :

import bpy
import bmesh
    
mesh = bpy.context.object.data  # Get selected object's mesh

bm = bmesh.from_edit_mesh(mesh) 
# Create new edit mode bmesh to easily acces mesh data
    
bm.verts.ensure_lookup_table()
bm.edges.ensure_lookup_table()
bm.faces.ensure_lookup_table()  # Ensure tables are up-to-date

for v in bm.verts:
    v.select = len(v.link_edges) in (2,3) 
# Select all vertices that have 2 or 3 links and deselect the others
    
bmesh.update_edit_mesh(mesh)  # Transfer the data back to the object's mesh

Source and Source 2

In your example, the 4 corners wouldn't get selected because they are connected to 2 edges.

However there is a handy operator with SHIFT + G or Select>Select Similar then "Amount of connecting edges"

enter image description here

Alternatively, if used in a script, you can use the operator :

bpy.ops.mesh.select_similar(type='EDGE', threshold=0.01)

But you need to first select some vertices.

enter image description here

If you can't select the vertices before running your script, use this :

import bpy
import bmesh
    
mesh = bpy.context.object.data  # Get selected object's mesh

bm = bmesh.from_edit_mesh(mesh) 
# Create new edit mode bmesh to easily acces mesh data
    
bm.verts.ensure_lookup_table()
bm.edges.ensure_lookup_table()
bm.faces.ensure_lookup_table()  # Ensure tables are up-to-date

for v in bm.verts:
    v.select = len(v.link_edges) in (2,3) 
# Select all vertices that have 2 or 3 links and deselect the others
    
bmesh.update_edit_mesh(mesh)  # Transfer the data back to the object's mesh

Source and Source 2

In your example, the 4 corners wouldn't get selected because they are connected to 2 edges.

However there is a handy operator with SHIFT + G or Select>Select Similar then "Amount of connecting edges"

enter image description here

Alternatively, if used in a script, you can use the operator :

bpy.ops.mesh.select_similar(type='EDGE', threshold=0.01)

But you need to first select some vertices.

enter image description here

If you can't select the vertices before running your script, use this :

import bpy
import bmesh
    
mesh = bpy.context.object.data  # Get selected object's mesh

bm = bmesh.from_edit_mesh(mesh) 
# Create new edit mode bmesh to easily acces mesh data
    

for v in bm.verts:
    v.select = len(v.link_edges) in (2,3) 
# Select all vertices that have 2 or 3 links and deselect the others
    
bmesh.update_edit_mesh(mesh)  # Transfer the data back to the object's mesh

Source and Source 2

simplified
Source Link
Gorgious
  • 31.6k
  • 2
  • 47
  • 104

In your example, the 4 corners wouldn't get selected because they are connected to 2 edges.

However there is a handy operator with SHIFT + G or Select>Select Similar then "Amount of connecting edges"

enter image description here

Alternatively, if used in a script, you can use the operator :

bpy.ops.mesh.select_similar(type='EDGE', threshold=0.01)

But you need to first select some vertices.

enter image description here

If you can't select the vertices before running your script, use this :

import bpy
import bmesh
 
obj = bpy.context.object  # Get selected object

mesh = objbpy.context.object.data  # Get selected object's mesh 

bm = bmesh.newfrom_edit_mesh(mesh)   
# Create new edit mode bmesh to easily acces mesh data
bm.from_mesh(mesh)  # Append mesh data

bm.verts.ensure_lookup_table()
bm.edges.ensure_lookup_table()
bm.faces.ensure_lookup_table()  # Ensure tables are up-to-date

bpy.ops.object.mode_set(mode='OBJECT') for #v Bmeshin manipulationsbm.verts:
 are done in Object Mode

(v.select_set(select = len(v.link_edges) in (2,3)) for v in bm.verts)  
# Select all vertices that have 2 or 3 links and deselect the others
    
bmbmesh.to_meshupdate_edit_mesh(mesh)  # Transfer the data back to the object's mesh
 
bpy.ops.object.mode_set(mode='EDIT')  # Go back to edit mode

Source

enter image description here and Source 2

In your example, the 4 corners wouldn't get selected because they are connected to 2 edges.

However there is a handy operator with SHIFT + G or Select>Select Similar then "Amount of connecting edges"

enter image description here

Alternatively, if used in a script, you can use the operator :

bpy.ops.mesh.select_similar(type='EDGE', threshold=0.01)

But you need to first select some vertices.

enter image description here

If you can't select the vertices before running your script, use this :

import bpy
import bmesh
 
obj = bpy.context.object  # Get selected object

mesh = obj.data  # Get selected object's mesh
bm = bmesh.new()  # Create new bmesh to easily acces mesh data
bm.from_mesh(mesh)  # Append mesh data

bm.verts.ensure_lookup_table()
bm.edges.ensure_lookup_table()
bm.faces.ensure_lookup_table()  # Ensure tables are up-to-date

bpy.ops.object.mode_set(mode='OBJECT')  # Bmesh manipulations are done in Object Mode

(v.select_set(len(v.link_edges) in (2,3)) for v in bm.verts)  
# Select all vertices that have 2 or 3 links and deselect the others

bm.to_mesh(mesh)  # Transfer the data back to the object's mesh
 
bpy.ops.object.mode_set(mode='EDIT')  # Go back to edit mode

Source

enter image description here

In your example, the 4 corners wouldn't get selected because they are connected to 2 edges.

However there is a handy operator with SHIFT + G or Select>Select Similar then "Amount of connecting edges"

enter image description here

Alternatively, if used in a script, you can use the operator :

bpy.ops.mesh.select_similar(type='EDGE', threshold=0.01)

But you need to first select some vertices.

enter image description here

If you can't select the vertices before running your script, use this :

import bpy
import bmesh
    
mesh = bpy.context.object.data  # Get selected object's mesh 

bm = bmesh.from_edit_mesh(mesh)  
# Create new edit mode bmesh to easily acces mesh data
    
bm.verts.ensure_lookup_table()
bm.edges.ensure_lookup_table()
bm.faces.ensure_lookup_table()  # Ensure tables are up-to-date

for v in bm.verts:
    v.select = len(v.link_edges) in (2,3) 
# Select all vertices that have 2 or 3 links and deselect the others
    
bmesh.update_edit_mesh(mesh)  # Transfer the data back to the object's mesh

Source and Source 2

Post Made Community Wiki by Gorgious
Source Link
Gorgious
  • 31.6k
  • 2
  • 47
  • 104
Loading