hi how are you?? thanks for reading
I’m want to add some custom objects to blender… that is so easy with some information in web and python templates, but the problem is that I need the vertex, faces and/or borders data in tuple or vector… (I’m not sure…
verts = [Vector((-1 * scale_x, 1 * scale_y, 0)), Vector((1 * scale_x, 1 * scale_y, 0)),
Vector((1 * scale_x, -1 * scale_y, 0)),
Vector((-1 * scale_x, -1 * scale_y, 0)),
that is from last python template)
then I try with cgcookie tutorial in order to access to that information : http://cgcookie.com/blender/2011/04/29/exporting-mesh-data-to-a-txt-file/comment-page-1/#comment-466682
import bpy
class exportToTXT(bpy.types.Operator):
bl_idname = "export.export_to_txt"
bl_label = "Export To TXT"
filepath = bpy.props.StringProperty(subtype="FILE_PATH")
def execute(self, context):
obverts = bpy.context.active_object.data.vertices
obfaces = bpy.context.active_object.data.faces
verts = []
faces = []
for vertex in obverts:
verts.append(tuple(vertex.co))
for face in obfaces:
faces.append(tuple(obfaces.vertices))
file = open(self.filepath, 'w')
file.write(str(verts))
file.write(str("
")) #para clarificar la distancia
file.write(str(faces))
return {'FINISHED'}
def invoke(self, context, event):
context.window_manager.fileselect_add(self)
return {'RUNNING_MODAL'}
class exportToTXTPanel(bpy.types.Panel):
bl_idname = "Export_To_TXT"
bl_label = "Export To TXT"
bl_space_type = "VIEW_3D"
bl_region_type = "TOOLS"
bñ_context = "objectmode"
def draw(self, context):
layout = self.layout
layout.operator("export.export_to_txt", text="Export to TXT")
def register():
bpy.utils.register_module(__name__)
def unregister():
bpy.utils.unregister_module(__name__)
if __name__ == "__main__":
register()
but this is for a last api, then this tutorial is out of date 
is really crazy because when I test the code in console that’s work but when I put into script that don’t work 
then I tried with object_creaprim.py addon but is the same think… is out of date…
then I tried to see some api reference but only see some things about MeshTessFace…
and now I’m here
do you can teach me please?
thanks a lot
Diego
