Skip to main content
1 of 8
TLousky
  • 16.1k
  • 1
  • 42
  • 73

You can use the bpy.ops.object.vertex_group_select operator in edit mode:

import bpy

o = bpy.context.object

bpy.ops.object.mode_set( mode = 'EDIT' )

# Set the first vertex group as active:
o.vertex_groups.active = o.vertex_groups[0]

# Deselect all verts and select only current VG    
bpy.ops.mesh.select_all( action = 'DESELECT' )
bpy.ops.object.vertex_group_select()

# Now the selected vertices are the ones that belong to this VG
vgVerts = [ v for v in o.data.vertices if v.select ]
TLousky
  • 16.1k
  • 1
  • 42
  • 73