[Bf-extensions-cvs] [81d846ba] master: removed register.module usage

zeffii noreply at git.blender.org
Tue Dec 26 12:13:04 CET 2017


Commit: 81d846baa2ebabadbda74b0f843fbf5ec7c268e0
Author: zeffii
Date:   Tue Dec 26 12:12:46 2017 +0100
Branches: master
https://developer.blender.org/rBA81d846baa2ebabadbda74b0f843fbf5ec7c268e0

removed register.module usage

===================================================================

M	mesh_tiny_cad/BIX.py
M	mesh_tiny_cad/CCEN.py
M	mesh_tiny_cad/CFG.py
M	mesh_tiny_cad/E2F.py
M	mesh_tiny_cad/V2X.py
M	mesh_tiny_cad/VTX.py
M	mesh_tiny_cad/XALL.py
M	mesh_tiny_cad/__init__.py

===================================================================

diff --git a/mesh_tiny_cad/BIX.py b/mesh_tiny_cad/BIX.py
index faac5212..89908f60 100644
--- a/mesh_tiny_cad/BIX.py
+++ b/mesh_tiny_cad/BIX.py
@@ -92,11 +92,3 @@ class TCLineOnBisection(bpy.types.Operator):
     def execute(self, context):
         add_line_to_bisection(self)
         return {'FINISHED'}
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
diff --git a/mesh_tiny_cad/CCEN.py b/mesh_tiny_cad/CCEN.py
index f625504b..ef2b5eae 100644
--- a/mesh_tiny_cad/CCEN.py
+++ b/mesh_tiny_cad/CCEN.py
@@ -157,11 +157,3 @@ class TCCircleCenter(bpy.types.Operator):
     def execute(self, context):
         dispatch(context, mode=1)
         return {'FINISHED'}
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
diff --git a/mesh_tiny_cad/CFG.py b/mesh_tiny_cad/CFG.py
index ed703a2f..55e0ff9f 100644
--- a/mesh_tiny_cad/CFG.py
+++ b/mesh_tiny_cad/CFG.py
@@ -74,11 +74,3 @@ def unregister_icons():
     for pcoll in icon_collection.values():
         bpy.utils.previews.remove(pcoll)
     icon_collection.clear()
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
diff --git a/mesh_tiny_cad/E2F.py b/mesh_tiny_cad/E2F.py
index 8c95f126..25f17e9f 100644
--- a/mesh_tiny_cad/E2F.py
+++ b/mesh_tiny_cad/E2F.py
@@ -100,11 +100,3 @@ class TCEdgeToFace(bpy.types.Operator):
     def execute(self, context):
         extend_vertex(self)
         return {'FINISHED'}
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
diff --git a/mesh_tiny_cad/V2X.py b/mesh_tiny_cad/V2X.py
index c230f4a2..c8683297 100644
--- a/mesh_tiny_cad/V2X.py
+++ b/mesh_tiny_cad/V2X.py
@@ -60,11 +60,3 @@ class TCVert2Intersection(bpy.types.Operator):
     def execute(self, context):
         add_vertex_to_intersection()
         return {'FINISHED'}
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
diff --git a/mesh_tiny_cad/VTX.py b/mesh_tiny_cad/VTX.py
index 5ad035b2..5cdb2fcf 100644
--- a/mesh_tiny_cad/VTX.py
+++ b/mesh_tiny_cad/VTX.py
@@ -173,11 +173,3 @@ class TCAutoVTX(bpy.types.Operator):
         bmesh.update_edit_mesh(me, True)
 
         return {'FINISHED'}
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
diff --git a/mesh_tiny_cad/XALL.py b/mesh_tiny_cad/XALL.py
index 83ecdb52..fc0ed76e 100644
--- a/mesh_tiny_cad/XALL.py
+++ b/mesh_tiny_cad/XALL.py
@@ -174,11 +174,3 @@ class TCIntersectAllEdges(bpy.types.Operator):
             print('must be in edit mode')
 
         return {'FINISHED'}
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
diff --git a/mesh_tiny_cad/__init__.py b/mesh_tiny_cad/__init__.py
index 611c67c4..4a9a62f0 100644
--- a/mesh_tiny_cad/__init__.py
+++ b/mesh_tiny_cad/__init__.py
@@ -50,7 +50,7 @@ if "bpy" in locals():
 
 import bpy
 
-from .CFG import TinyCADProperties
+from .CFG import TinyCADProperties, VIEW3D_MT_edit_mesh_tinycad
 from .CFG import register_icons, unregister_icons
 from . import VTX, V2X, XALL, BIX, CCEN, E2F
 
@@ -59,10 +59,20 @@ def menu_func(self, context):
     self.layout.menu("VIEW3D_MT_edit_mesh_tinycad")
     self.layout.separator()
 
+classes = [
+    TinyCADProperties, VIEW3D_MT_edit_mesh_tinycad,
+    VTX.TCAutoVTX,
+    XALL.TCIntersectAllEdges,
+    V2X.TCVert2Intersection,
+    E2F.TCEdgeToFace,
+    CCEN.TCCallBackCCEN, CCEN.TCCircleCenter,
+    BIX.TCLineOnBisection
+]
 
 def register():
     register_icons()
-    bpy.utils.register_module(__name__)
+    for cls in classes:
+        bpy.utils.register_class(cls)
     bpy.types.Scene.tinycad_props = bpy.props.PointerProperty(
         name="TinyCAD props", type=TinyCADProperties)
     bpy.types.VIEW3D_MT_edit_mesh_specials.prepend(menu_func)
@@ -70,6 +80,7 @@ def register():
 
 def unregister():
     bpy.types.VIEW3D_MT_edit_mesh_specials.remove(menu_func)
-    bpy.utils.unregister_module(__name__)
+    for cls in reversed(classes):
+        bpy.utils.unregister_class(cls)
     del bpy.types.Scene.tinycad_props
     unregister_icons()



More information about the Bf-extensions-cvs mailing list