Fix T98039: Node Wrangler node preview no longer working
[blender-addons.git] / add_mesh_discombobulator / __init__.py
blob9506f924ca4cff4550b365d8db872f3548ed6ea3
1 # SPDX-License-Identifier: GPL-2.0-or-later
3 # Contributed to by: Chichiri, Jace Priester #
4 # codemanx, blender dev team, Lijenstina, Spivak Vladimir (cwolf3d) #
5 # Originally by Evan J. Rosky (syrux)
7 bl_info = {
8 "name": "Discombobulator",
9 "author": "Evan J. Rosky (syrux)",
10 "version": (0, 1, 0),
11 "blender": (2, 80, 0),
12 "location": "View3D > Add > Mesh",
13 "description": "Add Discombobulator",
14 "warning": "",
15 "doc_url": "{BLENDER_MANUAL_URL}/addons/add_mesh/discombobulator.html",
16 "category": "Add Mesh",
19 # Note: Blocks has to be loaded before the WallFactory or the script
20 # will not work properly after (F8) reload
22 if "bpy" in locals():
23 import importlib
24 importlib.reload(mesh_discombobulator)
25 else:
26 from . import mesh_discombobulator
28 import bpy
29 from bpy.types import (
30 Menu,
31 PropertyGroup,
33 from bpy.props import (
34 PointerProperty,
37 # Register all operators and panels
39 # Define "Extras" menu
40 def menu_func(self, context):
41 layout = self.layout
42 layout.operator_context = 'INVOKE_REGION_WIN'
44 layout.separator()
45 layout.operator("discombobulate.ops",
46 text="Discombobulator", icon="MOD_BUILD")
49 # Properties
50 class DISCProps(PropertyGroup):
51 DISC_doodads = []
53 # Register
54 classes = (
55 mesh_discombobulator.discombobulator,
56 mesh_discombobulator.discombobulator_dodads_list,
57 mesh_discombobulator.discombob_help,
58 mesh_discombobulator.VIEW3D_OT_tools_discombobulate,
59 mesh_discombobulator.chooseDoodad,
60 mesh_discombobulator.unchooseDoodad,
61 DISCProps
64 def register():
65 from bpy.utils import register_class
66 for cls in classes:
67 register_class(cls)
69 bpy.types.Scene.discombobulator = PointerProperty(type=DISCProps)
70 # Add "Extras" menu to the "Add Mesh" menu
71 bpy.types.VIEW3D_MT_mesh_add.append(menu_func)
74 def unregister():
75 # Remove "Extras" menu from the "Add Mesh" menu.
76 bpy.types.VIEW3D_MT_mesh_add.remove(menu_func)
78 from bpy.utils import unregister_class
79 for cls in reversed(classes):
80 unregister_class(cls)
82 del bpy.types.Scene.discombobulator
84 if __name__ == "__main__":
85 register()