Hello everyone,
I’m attempting to write script/addon to convert mesh data into a python (.py) file. This is probably really basic and I am watching Patrick Boelens CGCookie tutorial on it. My issue is, it seems to be in working order, I am at the same point in the video as he first attempts to run it as an add-on. His works, but mine does not. As far as I can tell, I’ve written mine about the same as his, with a few minor changes:
import bpy
class exportToPY(bpy.types.Operator):
bl_idname = "export.export_to_py"
bl_label = "Export to PY"
def execute(self, context):
obverts = bpy.context.active_object.data.verticies
verts = []
for vertex in obverts:
verts.append(tuple(vertex.co))
print (verts)
return{'FINISHED'}
def register():
bpy.utils.register_module(__name__)
def unregister():
bpy.utils.unregister_module(__name__)
What exactly am I missing/doing wrong?
I’ll probably kick myself when I find out for making such a stupid mistake, but it’ll be worth it to get this working, so I can use it on my future projects.
Yeah, I could probably go copy and paste one from somewhere, but I’d rather have someone more wise teach me, so I can learn from my mistakes and move forward.