Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-08-02 15:53:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-02 15:53:48 +0400
commit3148c0f203ba23bead40e4e037bcc9a1eb27278b (patch)
tree1e91d053095e10a4b7afa1c392bb7525d3967cbe /object_fracture/__init__.py
parentd566152b0372d1d29578c3353f6a4d5ff3af4d63 (diff)
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
Diffstat (limited to 'object_fracture/__init__.py')
-rw-r--r--object_fracture/__init__.py34
1 files changed, 14 insertions, 20 deletions
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)