UI: initial dynamically generated sculpt tools

Lots more work needed, this just lists sculpt tools in the toolbar.
This commit is contained in:
Campbell Barton 2018-04-29 14:31:00 +02:00
parent 6e76a35f07
commit 76282a986d
1 changed files with 20 additions and 0 deletions

View File

@ -402,6 +402,23 @@ class _defs_edit_curve:
)
class _defs_sculpt:
@staticmethod
def generate_from_brushes(context):
for brush in context.blend_data.brushes:
name = brush.name
yield type(
"DynToolDef",
(ToolDef,),
dict(
text=name,
icon="none",
data_block=name,
)
)
class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'
@ -527,6 +544,9 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
_defs_edit_curve.draw,
_defs_edit_curve.extrude_cursor,
],
'SCULPT': [
_defs_sculpt.generate_from_brushes,
],
}