bl_info = { "name": "City of Heroes (.geo)", "author": "TigerKat", "version": (0, 1, 3), "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, 1.0, **keywords) class ImportGeoMetric(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, 0.30480000376701355, **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, 1.0, **keywords) class ExportGeoMetric(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, 1.0 / 0.30480000376701355, **keywords) def menu_func_import(self, context): self.layout.operator(ImportGeo.bl_idname, text="City of Heroes (Feet) (.geo)") self.layout.operator(ImportGeoMetric.bl_idname, text="City of Heroes (Meters) (.geo)") def menu_func_export(self, context): self.layout.operator(ExportGeo.bl_idname, text="City of Heroes (Feet) (.geo)") self.layout.operator(ExportGeoMetric.bl_idname, text="City of Heroes (Meters) (.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()