Alecu Posted September 15, 2010 Share Posted September 15, 2010 I have searched a lot about this and still haven't found anything. Any ideas how to get the vertex index for a certain vertex? Link to comment Share on other sites More sharing options...
throttlekitty Posted September 20, 2010 Share Posted September 20, 2010 I'm not a blender person, but doesn't it display this in the status bar, upper right? The 2.5x version has a status window that sounds like it might act a bit like Maya's, one may be able to query in there. Link to comment Share on other sites More sharing options...
Alecu Posted September 21, 2010 Author Share Posted September 21, 2010 (edited) It does have one,but it just displays the number of selected vertices. But it turn out you can get the index by writing a very simple python script that iterates through the vertex list and displays their indexes. I'll try to write one later and post it here. I won't have more than 60 lines or so. I'm currently trying to figure out how to add a textbox and some simple buttons in blender using the script. ;** Comment Line ** obj_blend = Blender.Object.Get("Cube") obj_blend.RotX = obj_blend.RotX + 90 print (obj_blend.Name) If Len(obj_blend.Name <= 0) : print("This is an example code box") Blender.Redraw() Return 0 Edited September 21, 2010 by LHammonds Added codebox BBCode as an example Link to comment Share on other sites More sharing options...
Alecu Posted September 22, 2010 Author Share Posted September 22, 2010 Thank you very much for the reply. I still learned a bit of python and made the script that writes all the selected vertices from all the objects in a text file.Here's the script: #!BPY """ Name: 'Export Selected Vertices' Blender: 249 Group: 'Export' Tooltip: 'Selected Vertices Exporter' """ import Blender import bpy def exportVertices(filename): out = file(filename, "w") sce = bpy.data.scenes.active for ob in sce.objects: try: mesh = ob.getData(mesh=1) out.write(ob.name + "\n") for vert in mesh.verts: if vert.sel == 1: out.write( ' v %s \n' % (vert.index) ) except: print( "Object %s probably doesn't have any vertices" % ( ob.name )) out.close() Blender.Window.FileSelector(exportVertices,"export") I was busy figuring out how to add some buttons with some options,like only exporting the vertices from a certain object. And some objects don't have the verts attribute,so I added an exception handler for that,but maybe if refers to the fact that the reference is null or something like that and accessing a null reference is illegal. I'll look into it a bit more. I really like the fact that you can write your own script for blender in a very nice language. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now