1 # SPDX-FileCopyrightText: 2011 Ryan Inch
3 # SPDX-License-Identifier: GPL-2.0-or-later
6 "name": "Dynamic Brush Menus",
7 "description": "Fast access to brushes & tools in Sculpt and Paint Modes",
8 "author": "Ryan Inch (Imaginer)",
10 "blender": (2, 80, 0),
11 "location": "Spacebar in Sculpt/Paint Modes",
13 "doc_url": "{BLENDER_MANUAL_URL}/addons/interface/brush_menus.html",
14 "category": "Interface",
20 importlib
.reload(utils_core
)
21 importlib
.reload(brush_menu
)
22 importlib
.reload(brushes
)
23 importlib
.reload(curve_menu
)
24 importlib
.reload(dyntopo_menu
)
25 importlib
.reload(stroke_menu
)
26 importlib
.reload(symmetry_menu
)
27 importlib
.reload(texture_menu
)
29 from . import utils_core
30 from . import brush_menu
32 from . import curve_menu
33 from . import dyntopo_menu
34 from . import stroke_menu
35 from . import symmetry_menu
36 from . import texture_menu
40 from bpy
.types
import AddonPreferences
41 from bpy
.props
import (
59 class VIEW3D_MT_Brushes_Pref(AddonPreferences
):
62 column_set
: IntProperty(
63 name
="Number of Columns",
64 description
="Number of columns used for the brushes menu",
70 def draw(self
, context
):
73 col
= layout
.column(align
=True)
74 col
.prop(self
, "column_set", slider
=True)
77 # New hotkeys and registration
84 for addon_file
in addon_files
:
87 # set the add-on name variable to access the preferences
88 utils_core
.get_addon_name
= __name__
90 # register preferences
91 bpy
.utils
.register_class(VIEW3D_MT_Brushes_Pref
)
94 wm
= bpy
.context
.window_manager
95 kc
= wm
.keyconfigs
.addon
98 modes
= ('Sculpt', 'Vertex Paint', 'Weight Paint', 'Image Paint', 'Particle')
100 km
= wm
.keyconfigs
.addon
.keymaps
.new(name
=mode
)
101 kmi
= km
.keymap_items
.new('wm.call_menu', 'SPACE', 'PRESS')
102 kmi
.properties
.name
= "VIEW3D_MT_sv3_brush_options"
103 addon_keymaps
.append((km
, kmi
))
107 # unregister all files
108 for addon_file
in addon_files
:
109 addon_file
.unregister()
111 # unregister preferences
112 bpy
.utils
.unregister_class(VIEW3D_MT_Brushes_Pref
)
114 for km
, kmi
in addon_keymaps
:
115 km
.keymap_items
.remove(kmi
)
116 addon_keymaps
.clear()
119 if __name__
== "__main__":