Below you will find the necessary code to get vertex information for yourself in a few easy steps. Running Blender in debug mode has index visualizer built in to allow you to see index information in realtime.
import bpy for item in bpy.data.objects: print(item.name) if item.type == 'MESH': for vertex in item.data.vertices: print(vertex.co)
or
import bpy for item in bpy.data.objects: print(item.name) if item.type == 'MESH': vert_list = [vertex.co for vertex in item.data.vertices] for vert in vert_list: print(vert)we can go even further.. print faces(polygons), vertices, indices, face normals
# blender 2.6x import bpy current_obj = bpy.context.active_object print("="*40) # printing marker for face in current_obj.data.polygons: verts_in_face = face.vertices[:] print("face index", face.index) print("normal", face.normal) for vert in verts_in_face: print("vert", vert, " vert co", current_obj.data.vertices[vert].co)if you need world coordinates, blenderscripting -- matrixworld will be a good place to find information. Compare the following snippet with the previous one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# blender 2.6x , printing world coordinates | |
import bpy | |
current_obj = bpy.context.active_object | |
print("="*40) # printing marker | |
for face in current_obj.data.polygons: | |
verts_in_face = face.vertices[:] | |
print("face index", face.index) | |
print("normal", face.normal) | |
for vert in verts_in_face: | |
local_point = current_obj.data.vertices[vert].co | |
world_point = current_obj.matrix_world * local_point | |
print("vert", vert, " vert co", world_point) |