nuclear@33: # Goat3D Blender >2.5 exporter nuclear@33: import bpy; nuclear@33: from bpy_extras.io_utils import ExportHelper nuclear@33: nuclear@33: bl_info = { nuclear@33: "name": "Goat3D scene", nuclear@33: "author": "John Tsiombikas", nuclear@33: "version": (0, 1), nuclear@33: "location": "File > Import-Export", nuclear@33: "description": "Mutant Stargoat, Goat3D scene file format: http://code.google.com/p/goat3d/", nuclear@33: "category": "Import-Export" nuclear@33: } nuclear@33: nuclear@33: class ExportGoat3D(bpy.types.Operator, ExportHelper): nuclear@33: bl_idname = "export.goat3d" nuclear@33: bl_label = "Goat3D scene export" nuclear@33: nuclear@33: fname = bpy.props.Stringproperty(subtype="FILE_PATH") nuclear@33: nuclear@33: @classmethod nuclear@33: def poll(cls, ctx): nuclear@33: return ctx.object is not None nuclear@33: nuclear@33: def execute(self, context): nuclear@33: file = open(self.filepath, "w") nuclear@33: file.write("foobar " + ctx.object.name) nuclear@33: return {'FINISHED'} nuclear@33: nuclear@33: def menu_func(self, ctx): nuclear@33: self.layout.operator_context = 'INVOKE_DEFAULT' nuclear@33: self.layout.operator(ExportGoat3D.bl_idname, text="Goat3D scene export") nuclear@33: nuclear@33: def register(): nuclear@33: bpy.utils.register_module(__name__) nuclear@33: bpy.types.INFO_MT_file_export.append(menu_func) nuclear@33: nuclear@33: def unregister(): nuclear@33: bpy.utils.unregister_module(__name__) nuclear@33: bpy.types.INFO_MT_file_export.remove(menu_func) nuclear@33: nuclear@33: if __name__ == "__main__": nuclear@33: register()