Fix #104941: Node Wrangler cannot use both bump and normal
[blender-addons.git] / add_mesh_discombobulator / __init__.py
blob6bdc6a12bb5364af2a987a6ea10a42ee96e8b551
1 # SPDX-FileCopyrightText: 2010-2022 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
5 # Contributed to by: Chichiri, Jace Priester #
6 # codemanx, blender dev team, Lijenstina, Spivak Vladimir (cwolf3d) #
7 # Originally by Evan J. Rosky (syrux)
9 bl_info = {
10 "name": "Discombobulator",
11 "author": "Evan J. Rosky (syrux)",
12 "version": (0, 1, 0),
13 "blender": (2, 80, 0),
14 "location": "View3D > Add > Mesh",
15 "description": "Add Discombobulator",
16 "warning": "",
17 "doc_url": "{BLENDER_MANUAL_URL}/addons/add_mesh/discombobulator.html",
18 "category": "Add Mesh",
21 # Note: Blocks has to be loaded before the WallFactory or the script
22 # will not work properly after (F8) reload
24 if "bpy" in locals():
25 import importlib
26 importlib.reload(mesh_discombobulator)
27 else:
28 from . import mesh_discombobulator
30 import bpy
31 from bpy.types import (
32 Menu,
33 PropertyGroup,
35 from bpy.props import (
36 PointerProperty,
39 # Register all operators and panels
41 # Define "Extras" menu
42 def menu_func(self, context):
43 layout = self.layout
44 layout.operator_context = 'INVOKE_REGION_WIN'
46 layout.separator()
47 layout.operator("discombobulate.ops",
48 text="Discombobulator", icon="MOD_BUILD")
51 # Properties
52 class DISCProps(PropertyGroup):
53 DISC_doodads = []
55 # Register
56 classes = (
57 mesh_discombobulator.discombobulator,
58 mesh_discombobulator.discombobulator_dodads_list,
59 mesh_discombobulator.discombob_help,
60 mesh_discombobulator.VIEW3D_OT_tools_discombobulate,
61 mesh_discombobulator.chooseDoodad,
62 mesh_discombobulator.unchooseDoodad,
63 DISCProps
66 def register():
67 from bpy.utils import register_class
68 for cls in classes:
69 register_class(cls)
71 bpy.types.Scene.discombobulator = PointerProperty(type=DISCProps)
72 # Add "Extras" menu to the "Add Mesh" menu
73 bpy.types.VIEW3D_MT_mesh_add.append(menu_func)
76 def unregister():
77 # Remove "Extras" menu from the "Add Mesh" menu.
78 bpy.types.VIEW3D_MT_mesh_add.remove(menu_func)
80 from bpy.utils import unregister_class
81 for cls in reversed(classes):
82 unregister_class(cls)
84 del bpy.types.Scene.discombobulator
86 if __name__ == "__main__":
87 register()