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 #####
18 # Modified by Meta-Androcto
20 """ Copyright 2011 GPL licence applies"""
23 "name": "Dynamic Brush Menus",
24 "description": "Fast access to brushes & tools in Sculpt and Paint Modes",
25 "author": "Ryan Inch (Imaginer)",
27 "blender": (2, 80, 0),
28 "location": "Spacebar in Sculpt/Paint Modes",
30 "doc_url": "{BLENDER_MANUAL_URL}/addons/interface/brush_menus.html",
31 "category": "Interface",
37 importlib
.reload(utils_core
)
38 importlib
.reload(brush_menu
)
39 importlib
.reload(brushes
)
40 importlib
.reload(curve_menu
)
41 importlib
.reload(dyntopo_menu
)
42 importlib
.reload(stroke_menu
)
43 importlib
.reload(symmetry_menu
)
44 importlib
.reload(texture_menu
)
46 from . import utils_core
47 from . import brush_menu
49 from . import curve_menu
50 from . import dyntopo_menu
51 from . import stroke_menu
52 from . import symmetry_menu
53 from . import texture_menu
57 from bpy
.types
import AddonPreferences
58 from bpy
.props
import (
76 class VIEW3D_MT_Brushes_Pref(AddonPreferences
):
79 column_set
: IntProperty(
80 name
="Number of Columns",
81 description
="Number of columns used for the brushes menu",
87 def draw(self
, context
):
90 col
= layout
.column(align
=True)
91 col
.prop(self
, "column_set", slider
=True)
94 # New hotkeys and registration
101 for addon_file
in addon_files
:
102 addon_file
.register()
104 # set the add-on name variable to access the preferences
105 utils_core
.get_addon_name
= __name__
107 # register preferences
108 bpy
.utils
.register_class(VIEW3D_MT_Brushes_Pref
)
111 wm
= bpy
.context
.window_manager
112 modes
= ('Sculpt', 'Vertex Paint', 'Weight Paint', 'Image Paint', 'Particle')
115 km
= wm
.keyconfigs
.addon
.keymaps
.new(name
=mode
)
116 kmi
= km
.keymap_items
.new('wm.call_menu', 'SPACE', 'PRESS')
117 kmi
.properties
.name
= "VIEW3D_MT_sv3_brush_options"
118 addon_keymaps
.append((km
, kmi
))
122 # unregister all files
123 for addon_file
in addon_files
:
124 addon_file
.unregister()
126 # unregister preferences
127 bpy
.utils
.unregister_class(VIEW3D_MT_Brushes_Pref
)
129 for km
, kmi
in addon_keymaps
:
130 km
.keymap_items
.remove(kmi
)
131 addon_keymaps
.clear()
134 if __name__
== "__main__":