change python scripts so modules which register with blender have a register() functi...
[blender.git] / release / scripts / io / export_ply.py
index d0712d820fdb69e77f56a09dc7fbdb67452bfc03..9bae14ff468ae3d7a89a0c4796cc8b81680a445c 100644 (file)
@@ -313,14 +313,15 @@ class ExportPLY(bpy.types.Operator):
         row.prop(props, "use_colors")
 
 
-bpy.types.register(ExportPLY)
-
-
 def menu_func(self, context):
     default_path = bpy.data.filename.replace(".blend", ".ply")
     self.layout.operator(ExportPLY.bl_idname, text="Stanford (.ply)...").path = default_path
 
-bpy.types.INFO_MT_file_export.append(menu_func)
 
-if __name__ == "__main__":
-    bpy.ops.export.ply(path="/tmp/test.ply")
+def register():
+    bpy.types.register(ExportPLY)
+    bpy.types.INFO_MT_file_export.append(menu_func)
+    
+def unregister():
+    bpy.types.unregister(ExportPLY)
+    bpy.types.INFO_MT_file_export.remove(menu_func)