animation_animall: return to release: T68332 T63750 e6a1dfbe53be
[blender-addons.git] / mesh_tiny_cad / __init__.py
blobee187180bda8f23ec7432b189e35b30e8c73306a
1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
19 # <pep8 compliant>
22 bl_info = {
23 "name": "tinyCAD Mesh tools",
24 "author": "zeffii (aka Dealga McArdle)",
25 "version": (1, 3, 2),
26 "blender": (2, 80, 0),
27 "category": "Mesh",
28 "location": "View3D > EditMode Context Menu",
29 "wiki_url": "http://zeffii.github.io/mesh_tiny_cad/",
30 "tracker_url": "https://github.com/zeffii/mesh_tiny_cad/issues"
34 if "bpy" in locals():
35 if 'VTX' in locals():
37 print('tinyCAD: detected reload event.')
38 import importlib
40 try:
41 modules = (CFG, VTX, V2X, XALL, BIX, CCEN, E2F)
42 for m in modules:
43 importlib.reload(m)
44 print("tinyCAD: reloaded modules, all systems operational")
46 except Exception as E:
47 print('reload failed with error:')
48 print(E)
51 import bpy
53 from .CFG import TinyCADProperties, VIEW3D_MT_edit_mesh_tinycad
54 from .CFG import register_icons, unregister_icons
55 from . import VTX, V2X, XALL, BIX, CCEN, E2F
58 def menu_func(self, context):
59 self.layout.menu("VIEW3D_MT_edit_mesh_tinycad")
60 self.layout.separator()
62 classes = [
63 TinyCADProperties, VIEW3D_MT_edit_mesh_tinycad,
64 VTX.TCAutoVTX,
65 XALL.TCIntersectAllEdges,
66 V2X.TCVert2Intersection,
67 E2F.TCEdgeToFace,
68 CCEN.TCCallBackCCEN, CCEN.TCCircleCenter,
69 BIX.TCLineOnBisection
72 def register():
73 register_icons()
74 for cls in classes:
75 bpy.utils.register_class(cls)
76 bpy.types.Scene.tinycad_props = bpy.props.PointerProperty(
77 name="TinyCAD props", type=TinyCADProperties)
78 bpy.types.VIEW3D_MT_edit_mesh_context_menu.prepend(menu_func)
81 def unregister():
82 bpy.types.VIEW3D_MT_edit_mesh_context_menu.remove(menu_func)
83 for cls in reversed(classes):
84 bpy.utils.unregister_class(cls)
85 del bpy.types.Scene.tinycad_props
86 unregister_icons()