# Getting the number of faces a certain vertex is part of

I am in edit mode and using bmesh to get all faces. I am iteration through the faces and their vertices. Now I want to know on how many faces the vertex, I currently have, is part of.

For example this green vertex is part of many faces.

Right now I have:

for f in mesh.faces:
for v in f.verts:
# some stuff before
# now I need the number of faces the vertex c is part of
# some other stuff


I know I could simply run through all faces and save the coordinates of the vertices and compare them with other faces and their coordinates - but maybe this can be done more easily.

Thanks!

• – zeffii May 17 '15 at 13:18
• Uh, you are right, the link_faces were there, too! I knew this was similar but haven't found it while skipping over it. Sorry! I still am learning. – Hamburml May 17 '15 at 13:45
• it's OK, it might better to have some overlap in questions, because there are many ways to ask a question, even if the answer is similar to all. Search results become better by directing to fewer related results. – zeffii May 17 '15 at 13:57

a very nice feature of bmesh :)

import bpy
import bmesh

me = bpy.context.object.data

# Get a BMesh representation
bm = bmesh.new()   # create an empty BMesh
bm.from_mesh(me)   # fill it in from a Mesh

for f in bm.faces:
for v in f.verts: