Tool System: use categories for tool identifiers
Tools that come with Blender use 'builtin' or 'builtin_brush' prefix.
This commit is contained in:
@@ -68,7 +68,7 @@ def generate(context, space_type):
|
|||||||
# a shortcut based workflow (before the tool system was added).
|
# a shortcut based workflow (before the tool system was added).
|
||||||
use_tap_reset = True
|
use_tap_reset = True
|
||||||
# TODO: support other tools for modes which don't use this tool.
|
# TODO: support other tools for modes which don't use this tool.
|
||||||
tap_reset_tool = "Cursor"
|
tap_reset_tool = "builtin.cursor"
|
||||||
# Check the tool is available in the current context.
|
# Check the tool is available in the current context.
|
||||||
if tap_reset_tool not in items_all_id:
|
if tap_reset_tool not in items_all_id:
|
||||||
use_tap_reset = False
|
use_tap_reset = False
|
||||||
@@ -317,7 +317,7 @@ def generate(context, space_type):
|
|||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
# Assign A-Z to Keys
|
# Assign A-Z to Keys
|
||||||
#
|
#
|
||||||
# When th keys are free.
|
# When the keys are free.
|
||||||
|
|
||||||
if use_auto_keymap_alpha:
|
if use_auto_keymap_alpha:
|
||||||
# Map all unmapped keys to numbers,
|
# Map all unmapped keys to numbers,
|
||||||
|
|||||||
@@ -5029,9 +5029,9 @@ def km_popup_toolbar(_params):
|
|||||||
"Toolbar Popup",
|
"Toolbar Popup",
|
||||||
{"space_type": 'EMPTY', "region_type": 'TEMPORARY'},
|
{"space_type": 'EMPTY', "region_type": 'TEMPORARY'},
|
||||||
{"items": [
|
{"items": [
|
||||||
op_tool("Select", {"type": 'W', "value": 'PRESS'}),
|
op_tool("builtin.select", {"type": 'W', "value": 'PRESS'}),
|
||||||
op_tool("Transform", {"type": 'T', "value": 'PRESS'}),
|
op_tool("builtin.transform", {"type": 'T', "value": 'PRESS'}),
|
||||||
op_tool("Measure", {"type": 'M', "value": 'PRESS'}),
|
op_tool("builtin.measure", {"type": 'M', "value": 'PRESS'}),
|
||||||
]},
|
]},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ def kmi_to_string_or_none(kmi):
|
|||||||
|
|
||||||
def generate_from_enum_ex(
|
def generate_from_enum_ex(
|
||||||
context, *,
|
context, *,
|
||||||
|
idname_prefix,
|
||||||
icon_prefix,
|
icon_prefix,
|
||||||
type,
|
type,
|
||||||
attr,
|
attr,
|
||||||
@@ -51,7 +52,7 @@ def generate_from_enum_ex(
|
|||||||
tool_defs.append(
|
tool_defs.append(
|
||||||
ToolDef.from_dict(
|
ToolDef.from_dict(
|
||||||
dict(
|
dict(
|
||||||
idname=name,
|
idname=idname_prefix + name,
|
||||||
label=name,
|
label=name,
|
||||||
icon=icon_prefix + idname.lower(),
|
icon=icon_prefix + idname.lower(),
|
||||||
data_block=idname,
|
data_block=idname,
|
||||||
@@ -86,7 +87,7 @@ class _defs_view3d_generic:
|
|||||||
layout.prop(props, "use_depth")
|
layout.prop(props, "use_depth")
|
||||||
layout.prop(props, "orientation")
|
layout.prop(props, "orientation")
|
||||||
return dict(
|
return dict(
|
||||||
idname="Cursor",
|
idname="builtin.cursor",
|
||||||
label="Cursor",
|
label="Cursor",
|
||||||
description=(
|
description=(
|
||||||
"Set the cursor location, drag to transform"
|
"Set the cursor location, drag to transform"
|
||||||
@@ -99,7 +100,7 @@ class _defs_view3d_generic:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def cursor_click():
|
def cursor_click():
|
||||||
return dict(
|
return dict(
|
||||||
idname="None",
|
idname="builtin.none",
|
||||||
label="None",
|
label="None",
|
||||||
icon="ops.generic.cursor",
|
icon="ops.generic.cursor",
|
||||||
keymap=(),
|
keymap=(),
|
||||||
@@ -126,7 +127,7 @@ class _defs_view3d_generic:
|
|||||||
kmi_to_string_or_none(kmi_remove),
|
kmi_to_string_or_none(kmi_remove),
|
||||||
)
|
)
|
||||||
return dict(
|
return dict(
|
||||||
idname="Measure",
|
idname="builtin.measure",
|
||||||
label="Measure",
|
label="Measure",
|
||||||
description=description,
|
description=description,
|
||||||
icon="ops.view3d.ruler",
|
icon="ops.view3d.ruler",
|
||||||
@@ -179,7 +180,7 @@ class _defs_annotate:
|
|||||||
@ToolDef.from_fn.with_args(draw_settings=draw_settings_common)
|
@ToolDef.from_fn.with_args(draw_settings=draw_settings_common)
|
||||||
def scribble(*, draw_settings):
|
def scribble(*, draw_settings):
|
||||||
return dict(
|
return dict(
|
||||||
idname="Annotate",
|
idname="builtin.annotate",
|
||||||
label="Annotate",
|
label="Annotate",
|
||||||
icon="ops.gpencil.draw",
|
icon="ops.gpencil.draw",
|
||||||
cursor='PAINT_BRUSH',
|
cursor='PAINT_BRUSH',
|
||||||
@@ -190,7 +191,7 @@ class _defs_annotate:
|
|||||||
@ToolDef.from_fn.with_args(draw_settings=draw_settings_common)
|
@ToolDef.from_fn.with_args(draw_settings=draw_settings_common)
|
||||||
def line(*, draw_settings):
|
def line(*, draw_settings):
|
||||||
return dict(
|
return dict(
|
||||||
idname="Annotate Line",
|
idname="builtin.annotate_line",
|
||||||
label="Annotate Line",
|
label="Annotate Line",
|
||||||
icon="ops.gpencil.draw.line",
|
icon="ops.gpencil.draw.line",
|
||||||
cursor='CROSSHAIR',
|
cursor='CROSSHAIR',
|
||||||
@@ -201,7 +202,7 @@ class _defs_annotate:
|
|||||||
@ToolDef.from_fn.with_args(draw_settings=draw_settings_common)
|
@ToolDef.from_fn.with_args(draw_settings=draw_settings_common)
|
||||||
def poly(*, draw_settings):
|
def poly(*, draw_settings):
|
||||||
return dict(
|
return dict(
|
||||||
idname="Annotate Polygon",
|
idname="builtin.annotate_polygon",
|
||||||
label="Annotate Polygon",
|
label="Annotate Polygon",
|
||||||
icon="ops.gpencil.draw.poly",
|
icon="ops.gpencil.draw.poly",
|
||||||
cursor='CROSSHAIR',
|
cursor='CROSSHAIR',
|
||||||
@@ -216,7 +217,7 @@ class _defs_annotate:
|
|||||||
prefs = context.preferences
|
prefs = context.preferences
|
||||||
layout.prop(prefs.edit, "grease_pencil_eraser_radius", text="Radius")
|
layout.prop(prefs.edit, "grease_pencil_eraser_radius", text="Radius")
|
||||||
return dict(
|
return dict(
|
||||||
idname="Annotate Eraser",
|
idname="builtin.annotate_eraser",
|
||||||
label="Annotate Eraser",
|
label="Annotate Eraser",
|
||||||
icon="ops.gpencil.draw.eraser",
|
icon="ops.gpencil.draw.eraser",
|
||||||
cursor='CROSSHAIR', # XXX: Always show brush circle when enabled
|
cursor='CROSSHAIR', # XXX: Always show brush circle when enabled
|
||||||
@@ -232,7 +233,7 @@ class _defs_transform:
|
|||||||
def draw_settings(context, layout, tool):
|
def draw_settings(context, layout, tool):
|
||||||
_template_widget.TRANSFORM_GGT_gizmo.draw_settings_with_index(context, layout, 1)
|
_template_widget.TRANSFORM_GGT_gizmo.draw_settings_with_index(context, layout, 1)
|
||||||
return dict(
|
return dict(
|
||||||
idname="Move",
|
idname="builtin.move",
|
||||||
label="Move",
|
label="Move",
|
||||||
# cursor='SCROLL_XY',
|
# cursor='SCROLL_XY',
|
||||||
icon="ops.transform.translate",
|
icon="ops.transform.translate",
|
||||||
@@ -247,7 +248,7 @@ class _defs_transform:
|
|||||||
def draw_settings(context, layout, tool):
|
def draw_settings(context, layout, tool):
|
||||||
_template_widget.TRANSFORM_GGT_gizmo.draw_settings_with_index(context, layout, 2)
|
_template_widget.TRANSFORM_GGT_gizmo.draw_settings_with_index(context, layout, 2)
|
||||||
return dict(
|
return dict(
|
||||||
idname="Rotate",
|
idname="builtin.rotate",
|
||||||
label="Rotate",
|
label="Rotate",
|
||||||
# cursor='SCROLL_XY',
|
# cursor='SCROLL_XY',
|
||||||
icon="ops.transform.rotate",
|
icon="ops.transform.rotate",
|
||||||
@@ -262,7 +263,7 @@ class _defs_transform:
|
|||||||
def draw_settings(context, layout, tool):
|
def draw_settings(context, layout, tool):
|
||||||
_template_widget.TRANSFORM_GGT_gizmo.draw_settings_with_index(context, layout, 3)
|
_template_widget.TRANSFORM_GGT_gizmo.draw_settings_with_index(context, layout, 3)
|
||||||
return dict(
|
return dict(
|
||||||
idname="Scale",
|
idname="builtin.scale",
|
||||||
label="Scale",
|
label="Scale",
|
||||||
# cursor='SCROLL_XY',
|
# cursor='SCROLL_XY',
|
||||||
icon="ops.transform.resize",
|
icon="ops.transform.resize",
|
||||||
@@ -277,7 +278,7 @@ class _defs_transform:
|
|||||||
def draw_settings(context, layout, tool):
|
def draw_settings(context, layout, tool):
|
||||||
_template_widget.TRANSFORM_GGT_gizmo.draw_settings_with_index(context, layout, 3)
|
_template_widget.TRANSFORM_GGT_gizmo.draw_settings_with_index(context, layout, 3)
|
||||||
return dict(
|
return dict(
|
||||||
idname="Scale Cage",
|
idname="builtin.scale_cage",
|
||||||
label="Scale Cage",
|
label="Scale Cage",
|
||||||
icon="ops.transform.resize.cage",
|
icon="ops.transform.resize.cage",
|
||||||
widget="VIEW3D_GGT_xform_cage",
|
widget="VIEW3D_GGT_xform_cage",
|
||||||
@@ -299,7 +300,7 @@ class _defs_transform:
|
|||||||
_template_widget.TRANSFORM_GGT_gizmo.draw_settings_with_index(context, layout, 1)
|
_template_widget.TRANSFORM_GGT_gizmo.draw_settings_with_index(context, layout, 1)
|
||||||
|
|
||||||
return dict(
|
return dict(
|
||||||
idname="Transform",
|
idname="builtin.transform",
|
||||||
label="Transform",
|
label="Transform",
|
||||||
description=(
|
description=(
|
||||||
"Supports any combination of grab, rotate & scale at once"
|
"Supports any combination of grab, rotate & scale at once"
|
||||||
@@ -318,7 +319,7 @@ class _defs_view3d_select:
|
|||||||
def draw_settings(context, layout, tool):
|
def draw_settings(context, layout, tool):
|
||||||
pass
|
pass
|
||||||
return dict(
|
return dict(
|
||||||
idname="Select",
|
idname="builtin.select",
|
||||||
label="Select",
|
label="Select",
|
||||||
icon="ops.generic.select",
|
icon="ops.generic.select",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -332,7 +333,7 @@ class _defs_view3d_select:
|
|||||||
props = tool.operator_properties("view3d.select_box")
|
props = tool.operator_properties("view3d.select_box")
|
||||||
layout.prop(props, "mode", expand=True)
|
layout.prop(props, "mode", expand=True)
|
||||||
return dict(
|
return dict(
|
||||||
idname="Select Box",
|
idname="builtin.select_box",
|
||||||
label="Select Box",
|
label="Select Box",
|
||||||
icon="ops.generic.select_box",
|
icon="ops.generic.select_box",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -346,7 +347,7 @@ class _defs_view3d_select:
|
|||||||
props = tool.operator_properties("view3d.select_lasso")
|
props = tool.operator_properties("view3d.select_lasso")
|
||||||
layout.prop(props, "mode", expand=True)
|
layout.prop(props, "mode", expand=True)
|
||||||
return dict(
|
return dict(
|
||||||
idname="Select Lasso",
|
idname="builtin.select_lasso",
|
||||||
label="Select Lasso",
|
label="Select Lasso",
|
||||||
icon="ops.generic.select_lasso",
|
icon="ops.generic.select_lasso",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -368,7 +369,7 @@ class _defs_view3d_select:
|
|||||||
draw_circle_2d(xy, (1.0,) * 4, radius, 32)
|
draw_circle_2d(xy, (1.0,) * 4, radius, 32)
|
||||||
|
|
||||||
return dict(
|
return dict(
|
||||||
idname="Select Circle",
|
idname="builtin.select_circle",
|
||||||
label="Select Circle",
|
label="Select Circle",
|
||||||
icon="ops.generic.select_circle",
|
icon="ops.generic.select_circle",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -387,7 +388,7 @@ class _defs_edit_armature:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def roll():
|
def roll():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Roll",
|
idname="builtin.roll",
|
||||||
label="Roll",
|
label="Roll",
|
||||||
icon="ops.armature.bone.roll",
|
icon="ops.armature.bone.roll",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -397,7 +398,7 @@ class _defs_edit_armature:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def bone_envelope():
|
def bone_envelope():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Bone Envelope",
|
idname="builtin.bone_envelope",
|
||||||
label="Bone Envelope",
|
label="Bone Envelope",
|
||||||
icon="ops.transform.bone_envelope",
|
icon="ops.transform.bone_envelope",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -407,7 +408,7 @@ class _defs_edit_armature:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def bone_size():
|
def bone_size():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Bone Size",
|
idname="builtin.bone_size",
|
||||||
label="Bone Size",
|
label="Bone Size",
|
||||||
icon="ops.transform.bone_size",
|
icon="ops.transform.bone_size",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -417,7 +418,7 @@ class _defs_edit_armature:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def extrude():
|
def extrude():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Extrude",
|
idname="builtin.extrude",
|
||||||
label="Extrude",
|
label="Extrude",
|
||||||
icon="ops.armature.extrude_move",
|
icon="ops.armature.extrude_move",
|
||||||
widget="VIEW3D_GGT_xform_extrude",
|
widget="VIEW3D_GGT_xform_extrude",
|
||||||
@@ -428,7 +429,7 @@ class _defs_edit_armature:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def extrude_cursor():
|
def extrude_cursor():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Extrude to Cursor",
|
idname="builtin.extrude_to_cursor",
|
||||||
label="Extrude to Cursor",
|
label="Extrude to Cursor",
|
||||||
icon="ops.armature.extrude_cursor",
|
icon="ops.armature.extrude_cursor",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -441,7 +442,7 @@ class _defs_edit_mesh:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def cube_add():
|
def cube_add():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Add Cube",
|
idname="builtin.add_cube",
|
||||||
label="Add Cube",
|
label="Add Cube",
|
||||||
icon="ops.mesh.primitive_cube_add_gizmo",
|
icon="ops.mesh.primitive_cube_add_gizmo",
|
||||||
description=(
|
description=(
|
||||||
@@ -459,7 +460,7 @@ class _defs_edit_mesh:
|
|||||||
layout.prop(props_macro, "use_fill")
|
layout.prop(props_macro, "use_fill")
|
||||||
|
|
||||||
return dict(
|
return dict(
|
||||||
idname="Rip Region",
|
idname="builtin.rip_region",
|
||||||
label="Rip Region",
|
label="Rip Region",
|
||||||
icon="ops.mesh.rip",
|
icon="ops.mesh.rip",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -470,7 +471,7 @@ class _defs_edit_mesh:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def rip_edge():
|
def rip_edge():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Rip Edge",
|
idname="builtin.rip_edge",
|
||||||
label="Rip Edge",
|
label="Rip Edge",
|
||||||
icon="ops.mesh.rip_edge",
|
icon="ops.mesh.rip_edge",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -480,7 +481,7 @@ class _defs_edit_mesh:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def poly_build():
|
def poly_build():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Poly Build",
|
idname="builtin.poly_build",
|
||||||
label="Poly Build",
|
label="Poly Build",
|
||||||
icon="ops.mesh.polybuild_hover",
|
icon="ops.mesh.polybuild_hover",
|
||||||
widget="VIEW3D_GGT_mesh_preselect_elem",
|
widget="VIEW3D_GGT_mesh_preselect_elem",
|
||||||
@@ -494,7 +495,7 @@ class _defs_edit_mesh:
|
|||||||
layout.prop(props, "correct_uv")
|
layout.prop(props, "correct_uv")
|
||||||
|
|
||||||
return dict(
|
return dict(
|
||||||
idname="Edge Slide",
|
idname="builtin.edge_slide",
|
||||||
label="Edge Slide",
|
label="Edge Slide",
|
||||||
icon="ops.transform.edge_slide",
|
icon="ops.transform.edge_slide",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -509,7 +510,7 @@ class _defs_edit_mesh:
|
|||||||
layout.prop(props, "correct_uv")
|
layout.prop(props, "correct_uv")
|
||||||
|
|
||||||
return dict(
|
return dict(
|
||||||
idname="Vertex Slide",
|
idname="builtin.vertex_slide",
|
||||||
label="Vertex Slide",
|
label="Vertex Slide",
|
||||||
icon="ops.transform.vert_slide",
|
icon="ops.transform.vert_slide",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -526,7 +527,7 @@ class _defs_edit_mesh:
|
|||||||
layout.prop(props, "axis")
|
layout.prop(props, "axis")
|
||||||
|
|
||||||
return dict(
|
return dict(
|
||||||
idname="Spin",
|
idname="builtin.spin",
|
||||||
label="Spin",
|
label="Spin",
|
||||||
icon="ops.mesh.spin",
|
icon="ops.mesh.spin",
|
||||||
widget="MESH_GGT_spin",
|
widget="MESH_GGT_spin",
|
||||||
@@ -543,7 +544,7 @@ class _defs_edit_mesh:
|
|||||||
layout.prop(props, "axis")
|
layout.prop(props, "axis")
|
||||||
|
|
||||||
return dict(
|
return dict(
|
||||||
idname="Spin Duplicates",
|
idname="builtin.spin_duplicates",
|
||||||
label="Spin Duplicates",
|
label="Spin Duplicates",
|
||||||
icon="ops.mesh.spin.duplicate",
|
icon="ops.mesh.spin.duplicate",
|
||||||
widget="MESH_GGT_spin",
|
widget="MESH_GGT_spin",
|
||||||
@@ -561,7 +562,7 @@ class _defs_edit_mesh:
|
|||||||
layout.prop(props, "use_relative_offset")
|
layout.prop(props, "use_relative_offset")
|
||||||
|
|
||||||
return dict(
|
return dict(
|
||||||
idname="Inset Faces",
|
idname="builtin.inset_faces",
|
||||||
label="Inset Faces",
|
label="Inset Faces",
|
||||||
icon="ops.mesh.inset",
|
icon="ops.mesh.inset",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -579,7 +580,7 @@ class _defs_edit_mesh:
|
|||||||
layout.prop(props, "vertex_only")
|
layout.prop(props, "vertex_only")
|
||||||
|
|
||||||
return dict(
|
return dict(
|
||||||
idname="Bevel",
|
idname="builtin.bevel",
|
||||||
label="Bevel",
|
label="Bevel",
|
||||||
icon="ops.mesh.bevel",
|
icon="ops.mesh.bevel",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -590,7 +591,7 @@ class _defs_edit_mesh:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def extrude():
|
def extrude():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Extrude Region",
|
idname="builtin.extrude_region",
|
||||||
label="Extrude Region",
|
label="Extrude Region",
|
||||||
# The operator description isn't useful in this case, give our own.
|
# The operator description isn't useful in this case, give our own.
|
||||||
description=(
|
description=(
|
||||||
@@ -611,7 +612,7 @@ class _defs_edit_mesh:
|
|||||||
props_macro = props.TRANSFORM_OT_shrink_fatten
|
props_macro = props.TRANSFORM_OT_shrink_fatten
|
||||||
layout.prop(props_macro, "use_even_offset")
|
layout.prop(props_macro, "use_even_offset")
|
||||||
return dict(
|
return dict(
|
||||||
idname="Extrude Along Normals",
|
idname="builtin.extrude_along_normals",
|
||||||
label="Extrude Along Normals",
|
label="Extrude Along Normals",
|
||||||
icon="ops.mesh.extrude_region_shrink_fatten",
|
icon="ops.mesh.extrude_region_shrink_fatten",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -623,7 +624,7 @@ class _defs_edit_mesh:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def extrude_individual():
|
def extrude_individual():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Extrude Individual",
|
idname="builtin.extrude_individual",
|
||||||
label="Extrude Individual",
|
label="Extrude Individual",
|
||||||
icon="ops.mesh.extrude_faces_move",
|
icon="ops.mesh.extrude_faces_move",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -637,7 +638,7 @@ class _defs_edit_mesh:
|
|||||||
layout.prop(props, "rotate_source")
|
layout.prop(props, "rotate_source")
|
||||||
|
|
||||||
return dict(
|
return dict(
|
||||||
idname="Extrude to Cursor",
|
idname="builtin.extrude_to_cursor",
|
||||||
label="Extrude to Cursor",
|
label="Extrude to Cursor",
|
||||||
icon="ops.mesh.dupli_extrude_cursor",
|
icon="ops.mesh.dupli_extrude_cursor",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -656,7 +657,7 @@ class _defs_edit_mesh:
|
|||||||
layout.prop(props_macro, "correct_uv")
|
layout.prop(props_macro, "correct_uv")
|
||||||
|
|
||||||
return dict(
|
return dict(
|
||||||
idname="Loop Cut",
|
idname="builtin.loop_cut",
|
||||||
label="Loop Cut",
|
label="Loop Cut",
|
||||||
icon="ops.mesh.loopcut_slide",
|
icon="ops.mesh.loopcut_slide",
|
||||||
widget="VIEW3D_GGT_mesh_preselect_edgering",
|
widget="VIEW3D_GGT_mesh_preselect_edgering",
|
||||||
@@ -667,7 +668,7 @@ class _defs_edit_mesh:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def offset_edge_loops_slide():
|
def offset_edge_loops_slide():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Offset Edge Loop Cut",
|
idname="builtin.offset_edge_loop_cut",
|
||||||
label="Offset Edge Loop Cut",
|
label="Offset Edge Loop Cut",
|
||||||
icon="ops.mesh.offset_edge_loops_slide",
|
icon="ops.mesh.offset_edge_loops_slide",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -680,7 +681,7 @@ class _defs_edit_mesh:
|
|||||||
props = tool.operator_properties("mesh.vertices_smooth")
|
props = tool.operator_properties("mesh.vertices_smooth")
|
||||||
layout.prop(props, "repeat")
|
layout.prop(props, "repeat")
|
||||||
return dict(
|
return dict(
|
||||||
idname="Smooth",
|
idname="builtin.smooth",
|
||||||
label="Smooth",
|
label="Smooth",
|
||||||
icon="ops.mesh.vertices_smooth",
|
icon="ops.mesh.vertices_smooth",
|
||||||
widget="WM_GGT_value_operator_redo",
|
widget="WM_GGT_value_operator_redo",
|
||||||
@@ -696,7 +697,7 @@ class _defs_edit_mesh:
|
|||||||
layout.prop(props, "normal")
|
layout.prop(props, "normal")
|
||||||
layout.prop(props, "seed")
|
layout.prop(props, "seed")
|
||||||
return dict(
|
return dict(
|
||||||
idname="Randomize",
|
idname="builtin.randomize",
|
||||||
label="Randomize",
|
label="Randomize",
|
||||||
icon="ops.transform.vertex_random",
|
icon="ops.transform.vertex_random",
|
||||||
widget="WM_GGT_value_operator_redo",
|
widget="WM_GGT_value_operator_redo",
|
||||||
@@ -712,7 +713,7 @@ class _defs_edit_mesh:
|
|||||||
layout.prop(props, "shear_axis", expand=True)
|
layout.prop(props, "shear_axis", expand=True)
|
||||||
_template_widget.TRANSFORM_GGT_gizmo.draw_settings_with_index(context, layout, 2)
|
_template_widget.TRANSFORM_GGT_gizmo.draw_settings_with_index(context, layout, 2)
|
||||||
return dict(
|
return dict(
|
||||||
idname="Shear",
|
idname="builtin.shear",
|
||||||
label="Shear",
|
label="Shear",
|
||||||
icon="ops.transform.shear",
|
icon="ops.transform.shear",
|
||||||
widget="VIEW3D_GGT_xform_shear",
|
widget="VIEW3D_GGT_xform_shear",
|
||||||
@@ -723,7 +724,7 @@ class _defs_edit_mesh:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def tosphere():
|
def tosphere():
|
||||||
return dict(
|
return dict(
|
||||||
idname="To Sphere",
|
idname="builtin.to_sphere",
|
||||||
label="To Sphere",
|
label="To Sphere",
|
||||||
icon="ops.transform.tosphere",
|
icon="ops.transform.tosphere",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -737,7 +738,7 @@ class _defs_edit_mesh:
|
|||||||
layout.prop(props, "use_even_offset")
|
layout.prop(props, "use_even_offset")
|
||||||
|
|
||||||
return dict(
|
return dict(
|
||||||
idname="Shrink/Fatten",
|
idname="builtin.shrink_fatten",
|
||||||
label="Shrink/Fatten",
|
label="Shrink/Fatten",
|
||||||
icon="ops.transform.shrink_fatten",
|
icon="ops.transform.shrink_fatten",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -748,7 +749,7 @@ class _defs_edit_mesh:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def push_pull():
|
def push_pull():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Push/Pull",
|
idname="builtin.push_pull",
|
||||||
label="Push/Pull",
|
label="Push/Pull",
|
||||||
icon="ops.transform.push_pull",
|
icon="ops.transform.push_pull",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -763,7 +764,7 @@ class _defs_edit_mesh:
|
|||||||
layout.prop(props, "only_selected")
|
layout.prop(props, "only_selected")
|
||||||
|
|
||||||
return dict(
|
return dict(
|
||||||
idname="Knife",
|
idname="builtin.knife",
|
||||||
label="Knife",
|
label="Knife",
|
||||||
icon="ops.mesh.knife_tool",
|
icon="ops.mesh.knife_tool",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -780,7 +781,7 @@ class _defs_edit_mesh:
|
|||||||
layout.prop(props, "clear_outer")
|
layout.prop(props, "clear_outer")
|
||||||
layout.prop(props, "threshold")
|
layout.prop(props, "threshold")
|
||||||
return dict(
|
return dict(
|
||||||
idname="Bisect",
|
idname="builtin.bisect",
|
||||||
label="Bisect",
|
label="Bisect",
|
||||||
icon="ops.mesh.bisect",
|
icon="ops.mesh.bisect",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -812,7 +813,7 @@ class _defs_edit_curve:
|
|||||||
col.prop(cps, "corner_angle")
|
col.prop(cps, "corner_angle")
|
||||||
|
|
||||||
return dict(
|
return dict(
|
||||||
idname="Draw",
|
idname="builtin.draw",
|
||||||
label="Draw",
|
label="Draw",
|
||||||
cursor='PAINT_BRUSH',
|
cursor='PAINT_BRUSH',
|
||||||
icon="ops.curve.draw",
|
icon="ops.curve.draw",
|
||||||
@@ -824,7 +825,7 @@ class _defs_edit_curve:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def extrude():
|
def extrude():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Extrude",
|
idname="builtin.extrude",
|
||||||
label="Extrude",
|
label="Extrude",
|
||||||
icon="ops.curve.extrude_move",
|
icon="ops.curve.extrude_move",
|
||||||
widget="VIEW3D_GGT_xform_extrude",
|
widget="VIEW3D_GGT_xform_extrude",
|
||||||
@@ -835,7 +836,7 @@ class _defs_edit_curve:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def extrude_cursor():
|
def extrude_cursor():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Extrude Cursor",
|
idname="builtin.extrude_cursor",
|
||||||
label="Extrude Cursor",
|
label="Extrude Cursor",
|
||||||
icon="ops.curve.extrude_cursor",
|
icon="ops.curve.extrude_cursor",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -845,7 +846,7 @@ class _defs_edit_curve:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def tilt():
|
def tilt():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Tilt",
|
idname="builtin.tilt",
|
||||||
label="Tilt",
|
label="Tilt",
|
||||||
icon="ops.transform.tilt",
|
icon="ops.transform.tilt",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -855,7 +856,7 @@ class _defs_edit_curve:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def curve_radius():
|
def curve_radius():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Radius",
|
idname="builtin.radius",
|
||||||
label="Radius",
|
label="Radius",
|
||||||
description=(
|
description=(
|
||||||
"Expand or contract the radius of the selected curve points"
|
"Expand or contract the radius of the selected curve points"
|
||||||
@@ -873,7 +874,7 @@ class _defs_edit_curve:
|
|||||||
layout.prop(props, "normal")
|
layout.prop(props, "normal")
|
||||||
layout.prop(props, "seed")
|
layout.prop(props, "seed")
|
||||||
return dict(
|
return dict(
|
||||||
idname="Randomize",
|
idname="builtin.randomize",
|
||||||
label="Randomize",
|
label="Randomize",
|
||||||
icon="ops.curve.vertex_random",
|
icon="ops.curve.vertex_random",
|
||||||
widget="WM_GGT_value_operator_redo",
|
widget="WM_GGT_value_operator_redo",
|
||||||
@@ -887,7 +888,7 @@ class _defs_pose:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def breakdown():
|
def breakdown():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Breakdowner",
|
idname="builtin.breakdowner",
|
||||||
label="Breakdowner",
|
label="Breakdowner",
|
||||||
icon="ops.pose.breakdowner",
|
icon="ops.pose.breakdowner",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -897,7 +898,7 @@ class _defs_pose:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def push():
|
def push():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Push",
|
idname="builtin.push",
|
||||||
label="Push",
|
label="Push",
|
||||||
icon="ops.pose.push",
|
icon="ops.pose.push",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -907,7 +908,7 @@ class _defs_pose:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def relax():
|
def relax():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Relax",
|
idname="builtin.relax",
|
||||||
label="Relax",
|
label="Relax",
|
||||||
icon="ops.pose.relax",
|
icon="ops.pose.relax",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -921,6 +922,7 @@ class _defs_particle:
|
|||||||
def generate_from_brushes(context):
|
def generate_from_brushes(context):
|
||||||
return generate_from_enum_ex(
|
return generate_from_enum_ex(
|
||||||
context,
|
context,
|
||||||
|
idname_prefix="builtin_brush.",
|
||||||
icon_prefix="brush.particle.",
|
icon_prefix="brush.particle.",
|
||||||
type=bpy.types.ParticleEdit,
|
type=bpy.types.ParticleEdit,
|
||||||
attr="tool",
|
attr="tool",
|
||||||
@@ -933,6 +935,7 @@ class _defs_sculpt:
|
|||||||
def generate_from_brushes(context):
|
def generate_from_brushes(context):
|
||||||
return generate_from_enum_ex(
|
return generate_from_enum_ex(
|
||||||
context,
|
context,
|
||||||
|
idname_prefix="builtin_brush.",
|
||||||
icon_prefix="brush.sculpt.",
|
icon_prefix="brush.sculpt.",
|
||||||
type=bpy.types.Brush,
|
type=bpy.types.Brush,
|
||||||
attr="sculpt_tool",
|
attr="sculpt_tool",
|
||||||
@@ -941,7 +944,7 @@ class _defs_sculpt:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def hide_border():
|
def hide_border():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Box Hide",
|
idname="builtin.box_hide",
|
||||||
label="Box Hide",
|
label="Box Hide",
|
||||||
icon="ops.sculpt.border_hide",
|
icon="ops.sculpt.border_hide",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -951,7 +954,7 @@ class _defs_sculpt:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def mask_border():
|
def mask_border():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Box Mask",
|
idname="builtin.box_mask",
|
||||||
label="Box Mask",
|
label="Box Mask",
|
||||||
icon="ops.sculpt.border_mask",
|
icon="ops.sculpt.border_mask",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -972,6 +975,7 @@ class _defs_vertex_paint:
|
|||||||
def generate_from_brushes(context):
|
def generate_from_brushes(context):
|
||||||
return generate_from_enum_ex(
|
return generate_from_enum_ex(
|
||||||
context,
|
context,
|
||||||
|
idname_prefix="builtin_brush.",
|
||||||
icon_prefix="brush.paint_vertex.",
|
icon_prefix="brush.paint_vertex.",
|
||||||
type=bpy.types.Brush,
|
type=bpy.types.Brush,
|
||||||
attr="vertex_tool",
|
attr="vertex_tool",
|
||||||
@@ -990,6 +994,7 @@ class _defs_texture_paint:
|
|||||||
def generate_from_brushes(context):
|
def generate_from_brushes(context):
|
||||||
return generate_from_enum_ex(
|
return generate_from_enum_ex(
|
||||||
context,
|
context,
|
||||||
|
idname_prefix="builtin_brush.",
|
||||||
icon_prefix="brush.paint_texture.",
|
icon_prefix="brush.paint_texture.",
|
||||||
type=bpy.types.Brush,
|
type=bpy.types.Brush,
|
||||||
attr="image_tool",
|
attr="image_tool",
|
||||||
@@ -1009,6 +1014,7 @@ class _defs_weight_paint:
|
|||||||
def generate_from_brushes(context):
|
def generate_from_brushes(context):
|
||||||
return generate_from_enum_ex(
|
return generate_from_enum_ex(
|
||||||
context,
|
context,
|
||||||
|
idname_prefix="builtin_brush.",
|
||||||
icon_prefix="brush.paint_weight.",
|
icon_prefix="brush.paint_weight.",
|
||||||
type=bpy.types.Brush,
|
type=bpy.types.Brush,
|
||||||
attr="weight_tool",
|
attr="weight_tool",
|
||||||
@@ -1017,7 +1023,7 @@ class _defs_weight_paint:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def sample_weight():
|
def sample_weight():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Sample Weight",
|
idname="builtin.sample_weight",
|
||||||
label="Sample Weight",
|
label="Sample Weight",
|
||||||
icon="ops.paint.weight_sample",
|
icon="ops.paint.weight_sample",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1027,7 +1033,7 @@ class _defs_weight_paint:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def sample_weight_group():
|
def sample_weight_group():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Sample Vertex Group",
|
idname="builtin.sample_vertex_group",
|
||||||
label="Sample Vertex Group",
|
label="Sample Vertex Group",
|
||||||
icon="ops.paint.weight_sample_group",
|
icon="ops.paint.weight_sample_group",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1046,7 +1052,7 @@ class _defs_weight_paint:
|
|||||||
layout.prop(props, "type")
|
layout.prop(props, "type")
|
||||||
|
|
||||||
return dict(
|
return dict(
|
||||||
idname="Gradient",
|
idname="builtin.gradient",
|
||||||
label="Gradient",
|
label="Gradient",
|
||||||
icon="ops.paint.weight_gradient",
|
icon="ops.paint.weight_gradient",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1069,7 +1075,7 @@ class _defs_image_generic:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def cursor():
|
def cursor():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Cursor",
|
idname="builtin.cursor",
|
||||||
label="Cursor",
|
label="Cursor",
|
||||||
description=(
|
description=(
|
||||||
"Set the cursor location, drag to transform"
|
"Set the cursor location, drag to transform"
|
||||||
@@ -1086,7 +1092,7 @@ class _defs_image_generic:
|
|||||||
props = tool.operator_properties("image.sample")
|
props = tool.operator_properties("image.sample")
|
||||||
layout.prop(props, "size")
|
layout.prop(props, "size")
|
||||||
return dict(
|
return dict(
|
||||||
idname="Sample",
|
idname="builtin.sample",
|
||||||
label="Sample",
|
label="Sample",
|
||||||
description=(
|
description=(
|
||||||
"Sample pixel values under the cursor"
|
"Sample pixel values under the cursor"
|
||||||
@@ -1102,7 +1108,7 @@ class _defs_image_uv_transform:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def transform():
|
def transform():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Transform",
|
idname="builtin.transform",
|
||||||
label="Transform",
|
label="Transform",
|
||||||
description=(
|
description=(
|
||||||
"Supports any combination of grab, rotate & scale at once"
|
"Supports any combination of grab, rotate & scale at once"
|
||||||
@@ -1120,7 +1126,7 @@ class _defs_image_uv_select:
|
|||||||
def draw_settings(context, layout, tool):
|
def draw_settings(context, layout, tool):
|
||||||
pass
|
pass
|
||||||
return dict(
|
return dict(
|
||||||
idname="Select",
|
idname="builtin.select",
|
||||||
label="Select",
|
label="Select",
|
||||||
icon="ops.generic.select",
|
icon="ops.generic.select",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1134,7 +1140,7 @@ class _defs_image_uv_select:
|
|||||||
props = tool.operator_properties("uv.select_box")
|
props = tool.operator_properties("uv.select_box")
|
||||||
layout.prop(props, "mode", expand=True)
|
layout.prop(props, "mode", expand=True)
|
||||||
return dict(
|
return dict(
|
||||||
idname="Select Box",
|
idname="builtin.select_box",
|
||||||
label="Select Box",
|
label="Select Box",
|
||||||
icon="ops.generic.select_box",
|
icon="ops.generic.select_box",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1148,7 +1154,7 @@ class _defs_image_uv_select:
|
|||||||
props = tool.operator_properties("uv.select_lasso")
|
props = tool.operator_properties("uv.select_lasso")
|
||||||
layout.prop(props, "mode", expand=True)
|
layout.prop(props, "mode", expand=True)
|
||||||
return dict(
|
return dict(
|
||||||
idname="Select Lasso",
|
idname="builtin.select_lasso",
|
||||||
label="Select Lasso",
|
label="Select Lasso",
|
||||||
icon="ops.generic.select_lasso",
|
icon="ops.generic.select_lasso",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1163,7 +1169,7 @@ class _defs_image_uv_select:
|
|||||||
layout.prop(props, "mode", expand=True)
|
layout.prop(props, "mode", expand=True)
|
||||||
layout.prop(props, "radius")
|
layout.prop(props, "radius")
|
||||||
return dict(
|
return dict(
|
||||||
idname="Select Circle",
|
idname="builtin.select_circle",
|
||||||
label="Select Circle",
|
label="Select Circle",
|
||||||
icon="ops.generic.select_circle",
|
icon="ops.generic.select_circle",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1178,6 +1184,7 @@ class _defs_image_uv_sculpt:
|
|||||||
def generate_from_brushes(context):
|
def generate_from_brushes(context):
|
||||||
return generate_from_enum_ex(
|
return generate_from_enum_ex(
|
||||||
context,
|
context,
|
||||||
|
idname_prefix="builtin_brush.",
|
||||||
icon_prefix="brush.uv_sculpt.",
|
icon_prefix="brush.uv_sculpt.",
|
||||||
type=bpy.types.ToolSettings,
|
type=bpy.types.ToolSettings,
|
||||||
attr="uv_sculpt_tool",
|
attr="uv_sculpt_tool",
|
||||||
@@ -1190,6 +1197,7 @@ class _defs_gpencil_paint:
|
|||||||
def generate_from_brushes(context):
|
def generate_from_brushes(context):
|
||||||
return generate_from_enum_ex(
|
return generate_from_enum_ex(
|
||||||
context,
|
context,
|
||||||
|
idname_prefix="builtin_brush.",
|
||||||
icon_prefix="brush.gpencil_draw.",
|
icon_prefix="brush.gpencil_draw.",
|
||||||
type=bpy.types.Brush,
|
type=bpy.types.Brush,
|
||||||
attr="gpencil_tool",
|
attr="gpencil_tool",
|
||||||
@@ -1201,7 +1209,7 @@ class _defs_gpencil_paint:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def cutter():
|
def cutter():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Cutter",
|
idname="builtin.cutter",
|
||||||
label="Cutter",
|
label="Cutter",
|
||||||
icon="ops.gpencil.stroke_cutter",
|
icon="ops.gpencil.stroke_cutter",
|
||||||
cursor='KNIFE',
|
cursor='KNIFE',
|
||||||
@@ -1212,7 +1220,7 @@ class _defs_gpencil_paint:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def line():
|
def line():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Line",
|
idname="builtin.line",
|
||||||
label="Line",
|
label="Line",
|
||||||
icon="ops.gpencil.primitive_line",
|
icon="ops.gpencil.primitive_line",
|
||||||
cursor='CROSSHAIR',
|
cursor='CROSSHAIR',
|
||||||
@@ -1223,7 +1231,7 @@ class _defs_gpencil_paint:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def box():
|
def box():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Box",
|
idname="builtin.box",
|
||||||
label="Box",
|
label="Box",
|
||||||
icon="ops.gpencil.primitive_box",
|
icon="ops.gpencil.primitive_box",
|
||||||
cursor='CROSSHAIR',
|
cursor='CROSSHAIR',
|
||||||
@@ -1234,7 +1242,7 @@ class _defs_gpencil_paint:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def circle():
|
def circle():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Circle",
|
idname="builtin.circle",
|
||||||
label="Circle",
|
label="Circle",
|
||||||
icon="ops.gpencil.primitive_circle",
|
icon="ops.gpencil.primitive_circle",
|
||||||
cursor='CROSSHAIR',
|
cursor='CROSSHAIR',
|
||||||
@@ -1245,7 +1253,7 @@ class _defs_gpencil_paint:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def arc():
|
def arc():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Arc",
|
idname="builtin.arc",
|
||||||
label="Arc",
|
label="Arc",
|
||||||
icon="ops.gpencil.primitive_arc",
|
icon="ops.gpencil.primitive_arc",
|
||||||
cursor='CROSSHAIR',
|
cursor='CROSSHAIR',
|
||||||
@@ -1256,7 +1264,7 @@ class _defs_gpencil_paint:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def curve():
|
def curve():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Curve",
|
idname="builtin.curve",
|
||||||
label="Curve",
|
label="Curve",
|
||||||
icon="ops.gpencil.primitive_curve",
|
icon="ops.gpencil.primitive_curve",
|
||||||
cursor='CROSSHAIR',
|
cursor='CROSSHAIR',
|
||||||
@@ -1269,7 +1277,7 @@ class _defs_gpencil_edit:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def bend():
|
def bend():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Bend",
|
idname="builtin.bend",
|
||||||
label="Bend",
|
label="Bend",
|
||||||
icon="ops.gpencil.edit_bend",
|
icon="ops.gpencil.edit_bend",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1281,7 +1289,7 @@ class _defs_gpencil_edit:
|
|||||||
def draw_settings(context, layout, tool):
|
def draw_settings(context, layout, tool):
|
||||||
layout.prop(context.tool_settings.gpencil_sculpt, "intersection_threshold")
|
layout.prop(context.tool_settings.gpencil_sculpt, "intersection_threshold")
|
||||||
return dict(
|
return dict(
|
||||||
idname="Select",
|
idname="builtin.select",
|
||||||
label="Select",
|
label="Select",
|
||||||
icon="ops.generic.select",
|
icon="ops.generic.select",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1296,7 +1304,7 @@ class _defs_gpencil_edit:
|
|||||||
layout.prop(props, "mode", expand=True)
|
layout.prop(props, "mode", expand=True)
|
||||||
layout.prop(context.tool_settings.gpencil_sculpt, "intersection_threshold")
|
layout.prop(context.tool_settings.gpencil_sculpt, "intersection_threshold")
|
||||||
return dict(
|
return dict(
|
||||||
idname="Select Box",
|
idname="builtin.select_box",
|
||||||
label="Select Box",
|
label="Select Box",
|
||||||
icon="ops.generic.select_box",
|
icon="ops.generic.select_box",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1311,7 +1319,7 @@ class _defs_gpencil_edit:
|
|||||||
layout.prop(props, "mode", expand=True)
|
layout.prop(props, "mode", expand=True)
|
||||||
layout.prop(context.tool_settings.gpencil_sculpt, "intersection_threshold")
|
layout.prop(context.tool_settings.gpencil_sculpt, "intersection_threshold")
|
||||||
return dict(
|
return dict(
|
||||||
idname="Select Lasso",
|
idname="builtin.select_lasso",
|
||||||
label="Select Lasso",
|
label="Select Lasso",
|
||||||
icon="ops.generic.select_lasso",
|
icon="ops.generic.select_lasso",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1327,7 +1335,7 @@ class _defs_gpencil_edit:
|
|||||||
layout.prop(props, "radius")
|
layout.prop(props, "radius")
|
||||||
layout.prop(context.tool_settings.gpencil_sculpt, "intersection_threshold")
|
layout.prop(context.tool_settings.gpencil_sculpt, "intersection_threshold")
|
||||||
return dict(
|
return dict(
|
||||||
idname="Select Circle",
|
idname="builtin.select_circle",
|
||||||
label="Select Circle",
|
label="Select Circle",
|
||||||
icon="ops.generic.select_circle",
|
icon="ops.generic.select_circle",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1338,7 +1346,7 @@ class _defs_gpencil_edit:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def radius():
|
def radius():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Radius",
|
idname="builtin.radius",
|
||||||
label="Radius",
|
label="Radius",
|
||||||
description=(
|
description=(
|
||||||
"Expand or contract the radius of the selected points"
|
"Expand or contract the radius of the selected points"
|
||||||
@@ -1352,7 +1360,7 @@ class _defs_gpencil_edit:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def shear():
|
def shear():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Shear",
|
idname="builtin.shear",
|
||||||
label="Shear",
|
label="Shear",
|
||||||
icon="ops.gpencil.edit_shear",
|
icon="ops.gpencil.edit_shear",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1362,7 +1370,7 @@ class _defs_gpencil_edit:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def tosphere():
|
def tosphere():
|
||||||
return dict(
|
return dict(
|
||||||
idname="To Sphere",
|
idname="builtin.to_sphere",
|
||||||
label="To Sphere",
|
label="To Sphere",
|
||||||
icon="ops.transform.tosphere",
|
icon="ops.transform.tosphere",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1372,7 +1380,7 @@ class _defs_gpencil_edit:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def extrude():
|
def extrude():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Extrude",
|
idname="builtin.extrude",
|
||||||
label="Extrude",
|
label="Extrude",
|
||||||
icon="ops.gpencil.extrude_move",
|
icon="ops.gpencil.extrude_move",
|
||||||
widget="VIEW3D_GGT_xform_extrude",
|
widget="VIEW3D_GGT_xform_extrude",
|
||||||
@@ -1387,6 +1395,7 @@ class _defs_gpencil_sculpt:
|
|||||||
def generate_from_brushes(context):
|
def generate_from_brushes(context):
|
||||||
return generate_from_enum_ex(
|
return generate_from_enum_ex(
|
||||||
context,
|
context,
|
||||||
|
idname_prefix="builtin_brush.",
|
||||||
icon_prefix="ops.gpencil.sculpt_",
|
icon_prefix="ops.gpencil.sculpt_",
|
||||||
type=bpy.types.GPencilSculptSettings,
|
type=bpy.types.GPencilSculptSettings,
|
||||||
attr="sculpt_tool",
|
attr="sculpt_tool",
|
||||||
@@ -1399,6 +1408,7 @@ class _defs_gpencil_weight:
|
|||||||
def generate_from_brushes(context):
|
def generate_from_brushes(context):
|
||||||
return generate_from_enum_ex(
|
return generate_from_enum_ex(
|
||||||
context,
|
context,
|
||||||
|
idname_prefix="builtin_brush.",
|
||||||
icon_prefix="ops.gpencil.sculpt_",
|
icon_prefix="ops.gpencil.sculpt_",
|
||||||
type=bpy.types.GPencilSculptSettings,
|
type=bpy.types.GPencilSculptSettings,
|
||||||
attr="weight_tool",
|
attr="weight_tool",
|
||||||
@@ -1412,7 +1422,7 @@ class _defs_node_select:
|
|||||||
def draw_settings(context, layout, tool):
|
def draw_settings(context, layout, tool):
|
||||||
pass
|
pass
|
||||||
return dict(
|
return dict(
|
||||||
idname="Select",
|
idname="builtin.select",
|
||||||
label="Select",
|
label="Select",
|
||||||
icon="ops.generic.select",
|
icon="ops.generic.select",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1427,7 +1437,7 @@ class _defs_node_select:
|
|||||||
layout.prop(props, "mode", expand=True)
|
layout.prop(props, "mode", expand=True)
|
||||||
pass
|
pass
|
||||||
return dict(
|
return dict(
|
||||||
idname="Select Box",
|
idname="builtin.select_box",
|
||||||
label="Select Box",
|
label="Select Box",
|
||||||
icon="ops.generic.select_box",
|
icon="ops.generic.select_box",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1441,7 +1451,7 @@ class _defs_node_select:
|
|||||||
props = tool.operator_properties("node.select_lasso")
|
props = tool.operator_properties("node.select_lasso")
|
||||||
layout.prop(props, "mode", expand=True)
|
layout.prop(props, "mode", expand=True)
|
||||||
return dict(
|
return dict(
|
||||||
idname="Select Lasso",
|
idname="builtin.select_lasso",
|
||||||
label="Select Lasso",
|
label="Select Lasso",
|
||||||
icon="ops.generic.select_lasso",
|
icon="ops.generic.select_lasso",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1456,7 +1466,7 @@ class _defs_node_select:
|
|||||||
layout.prop(props, "mode", expand=True)
|
layout.prop(props, "mode", expand=True)
|
||||||
layout.prop(props, "radius")
|
layout.prop(props, "radius")
|
||||||
return dict(
|
return dict(
|
||||||
idname="Select Circle",
|
idname="builtin.select_circle",
|
||||||
label="Select Circle",
|
label="Select Circle",
|
||||||
icon="ops.generic.select_circle",
|
icon="ops.generic.select_circle",
|
||||||
widget=None,
|
widget=None,
|
||||||
@@ -1470,7 +1480,7 @@ class _defs_node_edit:
|
|||||||
@ToolDef.from_fn
|
@ToolDef.from_fn
|
||||||
def links_cut():
|
def links_cut():
|
||||||
return dict(
|
return dict(
|
||||||
idname="Links Cut",
|
idname="builtin.links_cut",
|
||||||
label="Links Cut",
|
label="Links Cut",
|
||||||
icon="ops.node.links_cut",
|
icon="ops.node.links_cut",
|
||||||
widget=None,
|
widget=None,
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ class _draw_left_context_mode:
|
|||||||
|
|
||||||
is_paint = True
|
is_paint = True
|
||||||
# FIXME: tools must use their own UI drawing!
|
# FIXME: tools must use their own UI drawing!
|
||||||
if tool.idname in {"Line", "Box", "Circle", "Arc", "Curve"}:
|
if tool.idname in {"builtin.line", "builtin.box", "builtin.circle", "builtin.arc", "builtin.curve"}:
|
||||||
is_paint = False
|
is_paint = False
|
||||||
elif tool.idname == "Cutter":
|
elif tool.idname == "Cutter":
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
@@ -351,7 +351,7 @@ class _draw_left_context_mode:
|
|||||||
brush_basic_gpencil_paint_settings(layout, context, brush, compact=True)
|
brush_basic_gpencil_paint_settings(layout, context, brush, compact=True)
|
||||||
|
|
||||||
# FIXME: tools must use their own UI drawing!
|
# FIXME: tools must use their own UI drawing!
|
||||||
if tool.idname in {"Arc", "Curve", "Line", "Box", "Circle"}:
|
if tool.idname in {"builtin.arc", "builtin.curve", "builtin.line", "builtin.box", "builtin.circle"}:
|
||||||
settings = context.tool_settings.gpencil_sculpt
|
settings = context.tool_settings.gpencil_sculpt
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(settings, "use_thickness_curve", text="", icon='CURVE_DATA')
|
row.prop(settings, "use_thickness_curve", text="", icon='CURVE_DATA')
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ class VIEW3D_HT_header(Header):
|
|||||||
if object_mode == 'PAINT_GPENCIL':
|
if object_mode == 'PAINT_GPENCIL':
|
||||||
# FIXME: this is bad practice!
|
# FIXME: this is bad practice!
|
||||||
# Tool options are to be displayed in the topbar.
|
# Tool options are to be displayed in the topbar.
|
||||||
if context.workspace.tools.from_space_view3d_mode(object_mode).idname == "Draw":
|
if context.workspace.tools.from_space_view3d_mode(object_mode).idname == "builtin.draw":
|
||||||
settings = tool_settings.gpencil_sculpt.guide
|
settings = tool_settings.gpencil_sculpt.guide
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(settings, "use_guide", text="", icon='GRID')
|
row.prop(settings, "use_guide", text="", icon='GRID')
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
* and keep comment above the defines.
|
* and keep comment above the defines.
|
||||||
* Use STRINGIFY() rather than defining with quotes */
|
* Use STRINGIFY() rather than defining with quotes */
|
||||||
#define BLENDER_VERSION 280
|
#define BLENDER_VERSION 280
|
||||||
#define BLENDER_SUBVERSION 48
|
#define BLENDER_SUBVERSION 49
|
||||||
/* Several breakages with 280, e.g. collections vs layers */
|
/* Several breakages with 280, e.g. collections vs layers */
|
||||||
#define BLENDER_MINVERSION 280
|
#define BLENDER_MINVERSION 280
|
||||||
#define BLENDER_MINSUBVERSION 0
|
#define BLENDER_MINSUBVERSION 0
|
||||||
|
|||||||
@@ -2893,6 +2893,15 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!MAIN_VERSION_ATLEAST(bmain, 280, 49)) {
|
||||||
|
/* All tool names changed, reset to defaults. */
|
||||||
|
for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) {
|
||||||
|
while (!BLI_listbase_is_empty(&workspace->tools)) {
|
||||||
|
BKE_workspace_tool_remove(workspace, workspace->tools.first);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
/* Versioning code until next subversion bump goes here. */
|
/* Versioning code until next subversion bump goes here. */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1620,18 +1620,18 @@ static void WIDGETGROUP_gizmo_setup(const bContext *C, wmGizmoGroup *gzgroup)
|
|||||||
ScrArea *sa = CTX_wm_area(C);
|
ScrArea *sa = CTX_wm_area(C);
|
||||||
const bToolRef *tref = sa->runtime.tool;
|
const bToolRef *tref = sa->runtime.tool;
|
||||||
|
|
||||||
if (tref == NULL || STREQ(tref->idname, "Transform")) {
|
if (tref == NULL || STREQ(tref->idname, "builtin.transform")) {
|
||||||
/* Setup all gizmos, they can be toggled via 'ToolSettings.gizmo_flag' */
|
/* Setup all gizmos, they can be toggled via 'ToolSettings.gizmo_flag' */
|
||||||
ggd->twtype = SCE_GIZMO_SHOW_TRANSLATE | SCE_GIZMO_SHOW_ROTATE | SCE_GIZMO_SHOW_SCALE;
|
ggd->twtype = SCE_GIZMO_SHOW_TRANSLATE | SCE_GIZMO_SHOW_ROTATE | SCE_GIZMO_SHOW_SCALE;
|
||||||
ggd->use_twtype_refresh = true;
|
ggd->use_twtype_refresh = true;
|
||||||
}
|
}
|
||||||
else if (STREQ(tref->idname, "Move")) {
|
else if (STREQ(tref->idname, "builtin.move")) {
|
||||||
ggd->twtype |= SCE_GIZMO_SHOW_TRANSLATE;
|
ggd->twtype |= SCE_GIZMO_SHOW_TRANSLATE;
|
||||||
}
|
}
|
||||||
else if (STREQ(tref->idname, "Rotate")) {
|
else if (STREQ(tref->idname, "builtin.rotate")) {
|
||||||
ggd->twtype |= SCE_GIZMO_SHOW_ROTATE;
|
ggd->twtype |= SCE_GIZMO_SHOW_ROTATE;
|
||||||
}
|
}
|
||||||
else if (STREQ(tref->idname, "Scale")) {
|
else if (STREQ(tref->idname, "builtin.scale")) {
|
||||||
ggd->twtype |= SCE_GIZMO_SHOW_SCALE;
|
ggd->twtype |= SCE_GIZMO_SHOW_SCALE;
|
||||||
}
|
}
|
||||||
BLI_assert(ggd->twtype != 0);
|
BLI_assert(ggd->twtype != 0);
|
||||||
|
|||||||
@@ -475,7 +475,7 @@ void WM_toolsystem_ref_sync_from_context(
|
|||||||
const EnumPropertyItem *item = &items[i];
|
const EnumPropertyItem *item = &items[i];
|
||||||
if (!STREQ(tref_rt->data_block, item->identifier)) {
|
if (!STREQ(tref_rt->data_block, item->identifier)) {
|
||||||
STRNCPY(tref_rt->data_block, item->identifier);
|
STRNCPY(tref_rt->data_block, item->identifier);
|
||||||
STRNCPY(tref->idname, item->name);
|
SNPRINTF(tref->idname, "builtin_brush.%s", item->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -488,7 +488,7 @@ void WM_toolsystem_ref_sync_from_context(
|
|||||||
const EnumPropertyItem *item = &items[i];
|
const EnumPropertyItem *item = &items[i];
|
||||||
if (!STREQ(tref_rt->data_block, item->identifier)) {
|
if (!STREQ(tref_rt->data_block, item->identifier)) {
|
||||||
STRNCPY(tref_rt->data_block, item->identifier);
|
STRNCPY(tref_rt->data_block, item->identifier);
|
||||||
STRNCPY(tref->idname, item->name);
|
SNPRINTF(tref->idname, "builtin_brush.%s", item->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -501,7 +501,7 @@ void WM_toolsystem_ref_sync_from_context(
|
|||||||
const EnumPropertyItem *item = &items[i];
|
const EnumPropertyItem *item = &items[i];
|
||||||
if (!STREQ(tref_rt->data_block, item->identifier)) {
|
if (!STREQ(tref_rt->data_block, item->identifier)) {
|
||||||
STRNCPY(tref_rt->data_block, item->identifier);
|
STRNCPY(tref_rt->data_block, item->identifier);
|
||||||
STRNCPY(tref->idname, item->name);
|
SNPRINTF(tref->idname, "builtin_brush.%s", item->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -514,7 +514,7 @@ void WM_toolsystem_ref_sync_from_context(
|
|||||||
const EnumPropertyItem *item = &items[i];
|
const EnumPropertyItem *item = &items[i];
|
||||||
if (!STREQ(tref_rt->data_block, item->identifier)) {
|
if (!STREQ(tref_rt->data_block, item->identifier)) {
|
||||||
STRNCPY(tref_rt->data_block, item->identifier);
|
STRNCPY(tref_rt->data_block, item->identifier);
|
||||||
STRNCPY(tref->idname, item->name);
|
SNPRINTF(tref->idname, "builtin_brush.%s", item->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -532,7 +532,7 @@ void WM_toolsystem_ref_sync_from_context(
|
|||||||
const char *identifier = items[i].identifier;
|
const char *identifier = items[i].identifier;
|
||||||
if (!STREQ(tref_rt->data_block, identifier)) {
|
if (!STREQ(tref_rt->data_block, identifier)) {
|
||||||
STRNCPY(tref_rt->data_block, identifier);
|
STRNCPY(tref_rt->data_block, identifier);
|
||||||
STRNCPY(tref->idname, name);
|
SNPRINTF(tref->idname, "builtin_brush.%s", name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -790,31 +790,31 @@ static const char *toolsystem_default_tool(const bToolKey *tkey)
|
|||||||
case CTX_MODE_WEIGHT_GPENCIL:
|
case CTX_MODE_WEIGHT_GPENCIL:
|
||||||
case CTX_MODE_PAINT_TEXTURE:
|
case CTX_MODE_PAINT_TEXTURE:
|
||||||
case CTX_MODE_PAINT_GPENCIL:
|
case CTX_MODE_PAINT_GPENCIL:
|
||||||
return "Draw";
|
return "builtin_brush.Draw";
|
||||||
case CTX_MODE_SCULPT_GPENCIL:
|
case CTX_MODE_SCULPT_GPENCIL:
|
||||||
return "Push";
|
return "builtin_brush.Push";
|
||||||
/* end temporary hack. */
|
/* end temporary hack. */
|
||||||
|
|
||||||
case CTX_MODE_PARTICLE:
|
case CTX_MODE_PARTICLE:
|
||||||
return "Comb";
|
return "builtin_brush.Comb";
|
||||||
case CTX_MODE_EDIT_TEXT:
|
case CTX_MODE_EDIT_TEXT:
|
||||||
return "Cursor";
|
return "builtin.cursor";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SPACE_IMAGE:
|
case SPACE_IMAGE:
|
||||||
switch (tkey->mode) {
|
switch (tkey->mode) {
|
||||||
case SI_MODE_PAINT:
|
case SI_MODE_PAINT:
|
||||||
return "Draw";
|
return "builtin_brush.draw";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SPACE_NODE:
|
case SPACE_NODE:
|
||||||
{
|
{
|
||||||
/* 'Select Box' interferes with cut-links which is handy. */
|
/* 'Select Box' interferes with cut-links which is handy. */
|
||||||
return "Select";
|
return "builtin.select";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return "Select Box";
|
return "builtin.select_box";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user