Help with export script in 2.5x

Hi,

I have an old export script that does no longer work now. Can you please help me?
I need the vertex positions (global) of the selected mesh for each animation keyframe.

The old code was:


startFr = Blender.Get('staframe')
endFr = Blender.Get('endframe')
Blender.Set("curframe", 1)
#get the currently selected data structure
mesh_obj = Blender.Object.GetSelected()
	for vertex in mesh.verts:
		v = (vertex.co)


I think the rest should be compatible.
Can you also please put me a link where I can read up these commands?

Thank you very much.

best way would be to build an operator for this. that would look like:


import bpy

class Mesh_OT_getVertices(bpy.types.Operator):
    bl_label="get vertices"
    bl_idname="mesh.getVertices"
    bl_description="get vertex positions for each frame"

        def invoke(self, context, event):
            scene = context.scene
            startFr = scene.frame_start
            endFr = scene.frame_end

            mesh_obj = context.object

            for i in range(startFr, endFr+1):
                scene.frame_set(i)
                for vert in mesh_obj.data.vertices:
                    v = vert.co
                    #do your stuff with it
        return {'FINISHED'}


hope thats what you want
link to blender 2.5 py api is: http://www.blender.org/documentation/250PythonDoc/

hf

OK. Now I need a list of faces and for each face the vertex count (3 or 4?), plus the vertex index in the mesh.vertices list, plus the (main) UV coordinates of that vertex in the face.