update templates for registration changes
[blender.git] / release / scripts / templates / operator_export.py
index 4f950b11d0158ecd51f3c388011aa2f2c89bbd02..5390d32aeffa7a77837d462f55c04f0040afa5c0 100644 (file)
@@ -48,7 +48,19 @@ class ExportSomeData(bpy.types.Operator, ExportHelper):
 def menu_func_export(self, context):
     self.layout.operator(ExportSomeData.bl_idname, text="Text Export Operator")
 
-bpy.types.INFO_MT_file_export.append(menu_func_export)
+
+def register():
+    bpy.utils.register_class(ExportSomeData)
+    bpy.types.INFO_MT_file_export.append(menu_func_export)
+
+
+def unregister():
+    bpy.utils.unregister_class(ExportSomeData)
+    bpy.types.INFO_MT_file_export.remove(menu_func_export)
+
 
 if __name__ == "__main__":
+    register()
+
+    # test call
     bpy.ops.export.some_data('INVOKE_DEFAULT')