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 /add_mesh_BoltFactory/__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 'add_mesh_BoltFactory/__init__.py')
-rw-r--r--add_mesh_BoltFactory/__init__.py25
1 files changed, 11 insertions, 14 deletions
diff --git a/add_mesh_BoltFactory/__init__.py b/add_mesh_BoltFactory/__init__.py
index 94e7df69..7492ce38 100644
--- a/add_mesh_BoltFactory/__init__.py
+++ b/add_mesh_BoltFactory/__init__.py
@@ -28,31 +28,28 @@ bl_addon_info = {
'category': 'Add Mesh'}
import bpy
-from add_mesh_BoltFactory.Boltfactory import add_mesh_bolt
+
+try:
+ init_data
+
+ reload(Boltfactory)
+except:
+ from add_mesh_BoltFactory import Boltfactory
+
+init_data = True
################################################################################
##### REGISTER #####
-add_mesh_bolt_button = (lambda self, context: self.layout.operator
- (add_mesh_bolt.bl_idname, text="BOLT", icon="PLUGIN"))
+def add_mesh_bolt_button(self, context):
+ self.layout.operator(Boltfactory.add_mesh_bolt.bl_idname, text="BOLT", icon="PLUGIN")
-classes = [
-add_mesh_bolt
- ]
def register():
- register = bpy.types.register
- for cls in classes:
- register(cls)
-
bpy.types.INFO_MT_mesh_add.append(add_mesh_bolt_button)
#bpy.types.VIEW3D_PT_tools_objectmode.prepend(add_mesh_bolt_button) #just for testing
def unregister():
- unregister = bpy.types.unregister
- for cls in classes:
- unregister(cls)
-
bpy.types.INFO_MT_mesh_add.remove(add_mesh_bolt_button)
#bpy.types.VIEW3D_PT_tools_objectmode.remove(add_mesh_bolt_button) #just for testing