Node Wrangler: Add more specific poll methods
[blender-addons.git] / mesh_tiny_cad / __init__.py
blobdf632a3d0bc7e4dea786aa5940f418d32e242264
1 # SPDX-FileCopyrightText: 2016-2022 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
6 bl_info = {
7 "name": "tinyCAD Mesh tools",
8 "author": "zeffii (aka Dealga McArdle)",
9 "version": (1, 3, 2),
10 "blender": (2, 80, 0),
11 "location": "View3D > EditMode Context Menu",
12 "doc_url": "{BLENDER_MANUAL_URL}/addons/mesh/tinycad.html",
13 "tracker_url": "https://github.com/zeffii/mesh_tiny_cad/issues",
14 "category": "Mesh",
18 if "bpy" in locals():
19 if 'VTX' in locals():
21 print('tinyCAD: detected reload event.')
22 import importlib
24 try:
25 modules = (CFG, VTX, V2X, XALL, BIX, CCEN, E2F)
26 for m in modules:
27 importlib.reload(m)
28 print("tinyCAD: reloaded modules, all systems operational")
30 except Exception as E:
31 print('reload failed with error:')
32 print(E)
35 import bpy
37 from .CFG import TinyCADProperties, VIEW3D_MT_edit_mesh_tinycad
38 from .CFG import register_icons, unregister_icons
39 from . import VTX, V2X, XALL, BIX, CCEN, E2F
42 def menu_func(self, context):
43 self.layout.menu("VIEW3D_MT_edit_mesh_tinycad")
44 self.layout.separator()
46 classes = [
47 TinyCADProperties, VIEW3D_MT_edit_mesh_tinycad,
48 VTX.TCAutoVTX,
49 XALL.TCIntersectAllEdges,
50 V2X.TCVert2Intersection,
51 E2F.TCEdgeToFace,
52 CCEN.TCCallBackCCEN, CCEN.TCCircleCenter,
53 BIX.TCLineOnBisection
56 def register():
57 register_icons()
58 for cls in classes:
59 bpy.utils.register_class(cls)
60 bpy.types.Scene.tinycad_props = bpy.props.PointerProperty(
61 name="TinyCAD props", type=TinyCADProperties)
62 bpy.types.VIEW3D_MT_edit_mesh_context_menu.prepend(menu_func)
65 def unregister():
66 bpy.types.VIEW3D_MT_edit_mesh_context_menu.remove(menu_func)
67 for cls in reversed(classes):
68 bpy.utils.unregister_class(cls)
69 del bpy.types.Scene.tinycad_props
70 unregister_icons()