From 3148c0f203ba23bead40e4e037bcc9a1eb27278b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 2 Aug 2010 11:53:48 +0000 Subject: update addons to work with new register/unregister method, These scritps still need changes related to parent classes - mesh_surface_sketch.py - render_renderfarmfi.py - space_view3d_align_tools.py - object_cloud_gen.py --- object_fracture/__init__.py | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'object_fracture/__init__.py') diff --git a/object_fracture/__init__.py b/object_fracture/__init__.py index f1c87d6a..449baeae 100644 --- a/object_fracture/__init__.py +++ b/object_fracture/__init__.py @@ -33,8 +33,17 @@ bl_addon_info = { import bpy -from object_fracture import fracture_ops, fracture_setup +try: + init_data + + reload(fracture_ops) + reload(fracture_setup) +except: + from object_fracture import fracture_ops + from object_fracture import fracture_setup + +init_data = True class INFO_MT_add_fracture_objects(bpy.types.Menu): bl_idname = "INFO_MT_add_fracture_objects" @@ -52,33 +61,18 @@ class INFO_MT_add_fracture_objects(bpy.types.Menu): text="Rigidbody Recorder") import space_info -# Define the submenu -menu_func = (lambda self, - context: self.layout.menu("INFO_MT_add_fracture_objects", icon="PLUGIN")) -def register(): - bpy.types.register(fracture_ops.FractureSimple) - bpy.types.register(fracture_ops.FractureGroup) - bpy.types.register(fracture_ops.ImportFractureRecorder) - bpy.types.register(fracture_ops.ImportFractureBomb) - bpy.types.register(fracture_ops.ImportFractureProjectile) - bpy.types.register(fracture_setup.SetupFractureShards) - bpy.types.register(INFO_MT_add_fracture_objects) +def menu_func(self, context): + self.layout.menu("INFO_MT_add_fracture_objects", icon="PLUGIN") + +def register(): # Add the "add fracture objects" menu to the "Add" menu space_info.INFO_MT_add.append(menu_func) def unregister(): - bpy.types.unregister(fracture_ops.FractureSimple) - bpy.types.unregister(fracture_ops.FractureGroup) - bpy.types.unregister(fracture_ops.ImportFractureRecorder) - bpy.types.unregister(fracture_ops.ImportFractureBomb) - bpy.types.unregister(fracture_ops.ImportFractureProjectile) - bpy.types.unregister(fracture_setup.SetupFractureShards) - bpy.types.unregister(INFO_MT_add_fracture_objects) - # Remove "add fracture objects" menu from the "Add" menu. space_info.INFO_MT_add.remove(menu_func) -- cgit v1.2.3