From 271b7a5f58981e361a3d286f2c0b91970e6160cb Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Thu, 19 May 2011 10:35:46 +0200 Subject: [PATCH] fix for 2.57 --- io_import_off.py | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/io_import_off.py b/io_import_off.py index 1ca0854..86b825c 100644 --- a/io_import_off.py +++ b/io_import_off.py @@ -3,25 +3,19 @@ # Import DEC Object File Format (*.off) -bl_addon_info = { +bl_info = { "name": "Import DEC Object File Format (.off)", - "author": "Stefan Huber (shuber)", - "version": (0,7), - "blender": (2, 5, 3), + "author": "Stefan Huber (shuber2@gmail.com)", + "version": (0,0), + "blender": (2, 5, 57), "api": 31667, "location": "File > Import > Import DEC Object File Format (.off)", "description": "Import DEC Object File Format (.off) files", "warning": "", - "category": "Import/Export" + "category": "Import-Export" } - - -__author__ = "Stefan Huber" -#__url__ = ("blender", "blenderartists.org", "Author's homepage, http://www.redrival.com/scorpius") -#__version__ = "Part of IOSuite 0.5" - -__bpydoc__ = """\ +""" This script imports DEC Object File Format files to Blender. The DEC (Digital Equipment Corporation) OFF format is very old and @@ -41,6 +35,11 @@ Notes:
New Mesh module now used. - Cam """ +__version__ = '.'.join([str(s) for s in bl_info['version']]) + + + + import bpy from bpy.props import * @@ -176,19 +175,20 @@ def importFile(filepath, context): -class ImportOffFile(bpy.types.Operator): +class IMPORT_OT_dec_off(bpy.types.Operator): '''Import DEC object file format (.off) files as specified by http://shape.cs.princeton.edu/benchmark/documentation/off_format.html''' - bl_idname = "import.off_files" - bl_label = "Import DEC Object File Format (.off)" + bl_idname = "import_scene.dec_off" + bl_label = "Import DEC off" bl_description = "Imports DEC object file format (.off)" bl_options = {'REGISTER'} filepath = StringProperty(name="File Path", description="Filepath used for importing the file", maxlen=1024, - default="" ) + default="" + ) extEnum = [ ('*', 'All image formats', 'Import all know image (or movie) formats.'), @@ -216,13 +216,16 @@ http://shape.cs.princeton.edu/benchmark/documentation/off_format.html''' # Registering / Unregister def menu_func(self, context): - self.layout.operator(ImportOffFile.bl_idname, \ - text="DEC Object File Format (.off)", icon='PLUGIN') + self.layout.operator(IMPORT_OT_dec_off.bl_idname, + text="DEC Object File Format (.off)", + icon='PLUGIN' ) def register(): + bpy.utils.register_module(__name__) bpy.types.INFO_MT_file_import.append(menu_func) def unregister(): + bpy.utils.unregister_module(__name__) bpy.types.INFO_MT_file_import.remove(menu_func) -- 2.30.2