WIP: Brush assets project #106303
|
@ -1374,7 +1374,7 @@ class _defs_particle:
|
||||||
class _defs_sculpt:
|
class _defs_sculpt:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def generate_brush_tool(context):
|
def generate_from_brushes(context):
|
||||||
# Though `data_block` is conceptually unnecessary with a single brush tool,
|
# Though `data_block` is conceptually unnecessary with a single brush tool,
|
||||||
# it's still used because many areas assume that brush tools have it set #bToolRef.
|
# it's still used because many areas assume that brush tools have it set #bToolRef.
|
||||||
tool = None
|
tool = None
|
||||||
|
@ -2128,17 +2128,23 @@ class _defs_gpencil_paint:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def generate_from_brushes(context):
|
def generate_from_brushes(context):
|
||||||
return generate_from_enum_ex(
|
# Though `data_block` is conceptually unnecessary with a single brush tool,
|
||||||
context,
|
# it's still used because many areas assume that brush tools have it set #bToolRef.
|
||||||
idname_prefix="builtin_brush.",
|
tool = None
|
||||||
icon_prefix="brush.gpencil_draw.",
|
if context:
|
||||||
type=bpy.types.Brush,
|
brush = context.tool_settings.gpencil_paint.brush
|
||||||
attr="gpencil_tool",
|
if brush:
|
||||||
cursor='DOT',
|
tool = brush.gpencil_tool
|
||||||
tooldef_keywords=dict(
|
return [
|
||||||
operator="gpencil.draw",
|
ToolDef.from_dict(
|
||||||
),
|
dict(
|
||||||
)
|
idname="builtin.brush",
|
||||||
|
label="Brush",
|
||||||
|
icon="brush.sculpt.paint",
|
||||||
|
data_block=tool
|
||||||
|
)
|
||||||
|
)
|
||||||
|
]
|
||||||
|
|
||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def cutter():
|
def cutter():
|
||||||
|
@ -2494,16 +2500,24 @@ class _defs_gpencil_sculpt:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def generate_from_brushes(context):
|
def generate_from_brushes(context):
|
||||||
return generate_from_enum_ex(
|
# Though `data_block` is conceptually unnecessary with a single brush tool,
|
||||||
context,
|
# it's still used because many areas assume that brush tools have it set #bToolRef.
|
||||||
idname_prefix="builtin_brush.",
|
tool = None
|
||||||
icon_prefix="ops.gpencil.sculpt_",
|
if context:
|
||||||
type=bpy.types.Brush,
|
brush = context.tool_settings.gpencil_sculpt_paint.brush
|
||||||
attr="gpencil_sculpt_tool",
|
if brush:
|
||||||
tooldef_keywords=dict(
|
tool = brush.gpencil_sculpt_tool
|
||||||
operator="gpencil.sculpt_paint",
|
return [
|
||||||
),
|
ToolDef.from_dict(
|
||||||
)
|
dict(
|
||||||
|
idname="builtin.brush",
|
||||||
|
label="Brush",
|
||||||
|
icon="brush.sculpt.paint",
|
||||||
|
data_block=tool
|
||||||
|
)
|
||||||
|
)
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class _defs_grease_pencil_sculpt:
|
class _defs_grease_pencil_sculpt:
|
||||||
|
@ -2524,39 +2538,52 @@ class _defs_grease_pencil_sculpt:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def generate_from_brushes(context):
|
def generate_from_brushes(context):
|
||||||
return generate_from_enum_ex(
|
# Though `data_block` is conceptually unnecessary with a single brush tool,
|
||||||
context,
|
# it's still used because many areas assume that brush tools have it set #bToolRef.
|
||||||
idname_prefix="builtin_brush.",
|
tool = None
|
||||||
icon_prefix="ops.gpencil.sculpt_",
|
if context:
|
||||||
type=bpy.types.Brush,
|
brush = context.tool_settings.gpencil_sculpt.brush
|
||||||
# Uses GPv2 tool settings
|
if brush:
|
||||||
attr="gpencil_sculpt_tool",
|
tool = brush.gpencil_sculpt_tool
|
||||||
tooldef_keywords=dict(
|
return [
|
||||||
operator="grease_pencil.sculpt_paint",
|
ToolDef.from_dict(
|
||||||
),
|
dict(
|
||||||
)
|
idname="builtin.brush",
|
||||||
|
label="Brush",
|
||||||
|
icon="brush.sculpt.paint",
|
||||||
|
data_block=tool
|
||||||
|
)
|
||||||
|
)
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
class _defs_gpencil_weight:
|
class _defs_gpencil_weight:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def generate_from_brushes(context):
|
def generate_from_brushes(context):
|
||||||
return generate_from_enum_ex(
|
# Though `data_block` is conceptually unnecessary with a single brush tool,
|
||||||
context,
|
# it's still used because many areas assume that brush tools have it set #bToolRef.
|
||||||
idname_prefix="builtin_brush.",
|
tool = None
|
||||||
icon_prefix="ops.gpencil.sculpt_",
|
if context:
|
||||||
type=bpy.types.Brush,
|
brush = context.tool_settings.gpencil_weight_paint.brush
|
||||||
attr="gpencil_weight_tool",
|
if brush:
|
||||||
tooldef_keywords=dict(
|
tool = brush.gpencil_weight_tool
|
||||||
operator="gpencil.weight_paint",
|
return [
|
||||||
),
|
ToolDef.from_dict(
|
||||||
)
|
dict(
|
||||||
|
idname="builtin.brush",
|
||||||
|
label="Brush",
|
||||||
|
icon="brush.sculpt.paint",
|
||||||
|
data_block=tool
|
||||||
|
)
|
||||||
|
)
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
class _defs_curves_sculpt:
|
class _defs_curves_sculpt:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def generate_brush_tool(context):
|
def generate_from_brushes(context):
|
||||||
# Though `data_block` is conceptually unnecessary with a single brush tool,
|
# Though `data_block` is conceptually unnecessary with a single brush tool,
|
||||||
# it's still used because many areas assume that brush tools have it set #bToolRef.
|
# it's still used because many areas assume that brush tools have it set #bToolRef.
|
||||||
tool = None
|
tool = None
|
||||||
|
@ -2595,18 +2622,23 @@ class _defs_gpencil_vertex:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def generate_from_brushes(context):
|
def generate_from_brushes(context):
|
||||||
return generate_from_enum_ex(
|
# Though `data_block` is conceptually unnecessary with a single brush tool,
|
||||||
context,
|
# it's still used because many areas assume that brush tools have it set #bToolRef.
|
||||||
idname_prefix="builtin_brush.",
|
tool = None
|
||||||
icon_prefix="brush.paint_vertex.",
|
if context:
|
||||||
type=bpy.types.Brush,
|
brush = context.tool_settings.gpencil_vertex_paint.brush
|
||||||
attr="gpencil_vertex_tool",
|
if brush:
|
||||||
cursor='DOT',
|
tool = brush.gpencil_vertex_tool
|
||||||
tooldef_keywords=dict(
|
return [
|
||||||
operator="gpencil.vertex_paint",
|
ToolDef.from_dict(
|
||||||
),
|
dict(
|
||||||
)
|
idname="builtin.brush",
|
||||||
|
label="Brush",
|
||||||
|
icon="brush.sculpt.paint",
|
||||||
|
data_block=tool
|
||||||
|
)
|
||||||
|
)
|
||||||
|
]
|
||||||
|
|
||||||
class _defs_node_select:
|
class _defs_node_select:
|
||||||
|
|
||||||
|
@ -3206,9 +3238,7 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
|
||||||
_defs_particle.generate_from_brushes,
|
_defs_particle.generate_from_brushes,
|
||||||
],
|
],
|
||||||
'SCULPT': [
|
'SCULPT': [
|
||||||
lambda context: (
|
_defs_sculpt.generate_from_brushes,
|
||||||
_defs_sculpt.generate_brush_tool(context)
|
|
||||||
),
|
|
||||||
None,
|
None,
|
||||||
(
|
(
|
||||||
_defs_sculpt.mask_border,
|
_defs_sculpt.mask_border,
|
||||||
|
@ -3368,9 +3398,7 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
'SCULPT_CURVES': [
|
'SCULPT_CURVES': [
|
||||||
lambda context: (
|
_defs_curves_sculpt.generate_from_brushes,
|
||||||
_defs_curves_sculpt.generate_brush_tool(context)
|
|
||||||
),
|
|
||||||
None,
|
None,
|
||||||
*_tools_annotate,
|
*_tools_annotate,
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue