#!BPY # ######################################################################## # # Vertex Count - Counts vertices all objects in the current scene. # Copyright (C) 2007 Dave Jarvis (http://www.davidjarvis.ca) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # # ######################################################################## import Blender, operator from Blender import Scene, NMesh scene = Scene.GetCurrent() objects = [object for object in scene.objects if object.type == 'Mesh'] vertices = [] print "-] Vertex Count [----------------------------------------------" for object in objects: name = object.getName() mesh = NMesh.GetRawFromObject( name ) vertices.append( (name, len( mesh.verts )) ) map( operator.itemgetter(0), vertices ) map( operator.itemgetter(1), vertices ) for v in sorted( vertices, key=operator.itemgetter(1) ): print v print "-] Vertex Count [----------------------------------------------"