change python scripts so modules which register with blender have a register() functi...
[blender.git] / release / scripts / io / export_x3d.py
index c7210e5ceb7870555b998d0322ea0cbc746c1768..be648ddb11a9fdff1216791ec66fa578abec5d97 100644 (file)
@@ -1242,14 +1242,19 @@ class ExportX3D(bpy.types.Operator):
         wm.add_fileselect(self)
         return {'RUNNING_MODAL'}
 
-bpy.types.register(ExportX3D)
-
 
 def menu_func(self, context):
     default_path = bpy.data.filename.replace(".blend", ".x3d")
     self.layout.operator(ExportX3D.bl_idname, text="X3D Extensible 3D (.x3d)...").path = default_path
 
-bpy.types.INFO_MT_file_export.append(menu_func)
+
+def register():
+    bpy.types.register(ExportX3D)
+    bpy.types.INFO_MT_file_export.append(menu_func)
+    
+def unregister():
+    bpy.types.unregister(ExportX3D)
+    bpy.types.INFO_MT_file_export.remove(menu_func)
 
 # NOTES
 # - blender version is hardcoded