fix to register/deregister properly
authorCampbell Barton <ideasman42@gmail.com>
Mon, 13 Sep 2010 07:44:50 +0000 (07:44 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 13 Sep 2010 07:44:50 +0000 (07:44 +0000)
io_export_md3.py

index 5e11d02fa959c49cd8d714565a0705377dac62fd..319d82dacb0886e75cd9af3742d3fe908afdee37 100644 (file)
 #
 # ##### END GPL LICENSE BLOCK #####
 
-__author__ = ["Xembie"]
-__version__ = '0.7'
-__url__ = ["www.blender.org"]
-
-"""
-Name: 'Quake Model 3 (.md3)...'
-Blender: 253
-Group: 'Export'
-Tooltip: 'Save a Quake Model 3 File'
-"""
-
 bl_addon_info = {
     'name': 'Quake Model 3 (.md3)',
     'author': 'Xembie',
@@ -38,10 +27,13 @@ bl_addon_info = {
     'warning': '', # used for warning icon and text in addons panel
     'wiki_url': 'http://wiki.blender.org/index.php/Extensions:2.5/Py/'\
         'Scripts/',
-    'tracker_url': 'http://projects.blender.org/tracker/index.php?'\
-           'func=detail&aid=23160&group_id=153&atid=468',
+    'tracker_url': 'http://projects.blender.org/tracker/index.php?func=detail&aid=23160&group_id=153&atid=468',
     'category': 'Import/Export'}
 
+__author__ = ["Xembie"]
+__version__ = '0.7'
+__url__ = ["www.blender.org"]
+
 import bpy,struct,math,os
 
 MAX_QPATH = 64
@@ -687,19 +679,18 @@ class ExportMD3(bpy.types.Operator):
     wm.add_fileselect(self)
     return {'RUNNING_MODAL'}
 
-  def poll(self, context):
-    return context.active_object != None
+  @classmethod
+  def poll(cls, context):
+    return context.active_object is not None
 
 def menu_func(self, context):
   newpath = os.path.splitext(bpy.context.main.filepath)[0] + ".md3"
   self.layout.operator(ExportMD3.bl_idname, text="Quake Model 3 (.md3)").filepath = newpath 
 
 def register():
-  bpy.types.register(ExportMD3)
   bpy.types.INFO_MT_file_export.append(menu_func)
 
 def unregister():
-  bpy.types.unregister(ExportMD3)
   bpy.types.INFO_MT_file_export.remove(menu_func)
 
 if __name__ == "__main__":