bl_info = { "name": "City of Heroes (.geo)", "author": "TigerKat", "version": (0, 1), "blender": (2, 79, 0), "location": "File > Import/Export,", "description": "City of Heroes (.geo)", "tracker_url": "https://git.ourodev.com/tigerkat/geopy/issues", "warning": "", "category": "Import-Export"} if "bpy" in locals(): import importlib if "import_geo" in locals(): importlib.reload(import_geo) if "export_geo" in locals(): importlib.reload(export_geo) if "geo" in locals(): importlib.reload(geo) if "geomesh" in locals(): importlib.reload(geomesh) if "vec_math" in locals(): importlib.reload(vec_math) ## Python doesn't reload package sub-modules at the same time as __init__.py! #import os.path #import imp, sys #for filename in [ f for f in os.listdir(os.path.dirname(os.path.realpath(__file__))) if f.endswith(".py") ]: # if filename == os.path.basename(__file__): continue # mod = sys.modules.get("{}.{}".format(__name__,filename[:-3])) # if mod: imp.reload(mod) import mathutils import bpy from bpy.props import ( BoolProperty, EnumProperty, FloatProperty, StringProperty, ) from bpy_extras.io_utils import ( ImportHelper, ExportHelper, ) ############################################################################## class ImportGeo(bpy.types.Operator, ImportHelper): bl_idname = "import_scene.geo" bl_label = "Import GEO" filename_ext = ".geo" filter_glob = StringProperty(default="*.geo", options={'HIDDEN'}) def execute(self, context): from . import import_geo keywords = self.as_keywords(ignore=("filter_glob",)) return import_geo.load(self, context, **keywords) class ExportGeo(bpy.types.Operator, ExportHelper): bl_idname = "export_scene.geo" bl_label = "Export GEO" filename_ext = ".geo" filter_glob = StringProperty(default="*.geo", options={'HIDDEN'}) def execute(self, context): from . import export_geo keywords = self.as_keywords(ignore=("filter_glob", "check_existing", )) return export_geo.save(self, context, **keywords) def menu_func_import(self, context): self.layout.operator(ImportGeo.bl_idname, text="City of Heroes (.geo)") def menu_func_export(self, context): self.layout.operator(ExportGeo.bl_idname, text="City of Heroes (.geo)") def register(): bpy.utils.register_module(__name__) bpy.types.INFO_MT_file_import.append(menu_func_import) bpy.types.INFO_MT_file_export.append(menu_func_export) def unregister(): bpy.utils.unregister_module(__name__) bpy.types.INFO_MT_file_import.remove(menu_func_import) bpy.types.INFO_MT_file_export.remove(menu_func_export) if __name__ == "__main__": register()