[Bf-blender-cvs] [e255e5445c7] temp-sculpt-normals-masking: temp-sculpt-normals-masking: Remove unwanted formatting changes
Joseph Eagar
noreply at git.blender.org
Sat Jul 30 20:34:58 CEST 2022
Commit: e255e5445c71bb93e32038c8cd581770e59147e2
Author: Joseph Eagar
Date: Sat Jul 30 11:34:38 2022 -0700
Branches: temp-sculpt-normals-masking
https://developer.blender.org/rBe255e5445c71bb93e32038c8cd581770e59147e2
temp-sculpt-normals-masking: Remove unwanted formatting changes
===================================================================
M release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 25c05445415..470b78ae558 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -25,15 +25,14 @@ def kmi_to_string_or_none(kmi):
def generate_from_enum_ex(
- _context,
- *,
- idname_prefix,
- icon_prefix,
- type,
- attr,
- cursor="DEFAULT",
- tooldef_keywords={},
- exclude_filter={}
+ _context, *,
+ idname_prefix,
+ icon_prefix,
+ type,
+ attr,
+ cursor='DEFAULT',
+ tooldef_keywords={},
+ exclude_filter={}
):
tool_defs = []
for enum in type.bl_rna.properties[attr].enum_items_static:
@@ -79,15 +78,16 @@ class _defs_view3d_generic:
props = tool.operator_properties("view3d.cursor3d")
layout.prop(props, "use_depth")
layout.prop(props, "orientation")
-
return dict(
idname="builtin.cursor",
label="Cursor",
- description=("Set the cursor location, drag to transform"),
+ description=(
+ "Set the cursor location, drag to transform"
+ ),
icon="ops.generic.cursor",
keymap="3D View Tool: Cursor",
draw_settings=draw_settings,
- options={"KEYMAP_FALLBACK"},
+ options={'KEYMAP_FALLBACK'},
)
@ToolDef.from_fn
@@ -119,7 +119,6 @@ class _defs_view3d_generic:
kmi_to_string_or_none(kmi_add),
kmi_to_string_or_none(kmi_remove),
)
-
return dict(
idname="builtin.measure",
label="Measure",
@@ -127,11 +126,12 @@ class _defs_view3d_generic:
icon="ops.view3d.ruler",
widget="VIEW3D_GGT_ruler",
keymap="3D View Tool: Measure",
- options={"KEYMAP_FALLBACK"},
+ options={'KEYMAP_FALLBACK'},
)
class _defs_annotate:
+
def draw_settings_common(context, layout, tool):
gpd = context.annotation_data
region_type = context.region.type
@@ -141,15 +141,15 @@ class _defs_annotate:
text = gpd.layers.active_note
maxw = 25
if len(text) > maxw:
- text = text[: maxw - 5] + ".." + text[-3:]
+ text = text[:maxw - 5] + '..' + text[-3:]
else:
text = ""
gpl = context.active_annotation_layer
if gpl is not None:
layout.label(text="Annotation:")
- if context.space_data.type in {"VIEW_3D", "SEQUENCE_EDITOR"}:
- if region_type == "TOOL_HEADER":
+ if context.space_data.type in {'VIEW_3D', 'SEQUENCE_EDITOR'}:
+ if region_type == 'TOOL_HEADER':
sub = layout.split(align=True, factor=0.5)
sub.ui_units_x = 6.5
sub.prop(gpl, "color", text="")
@@ -166,30 +166,21 @@ class _defs_annotate:
space_type = tool.space_type
tool_settings = context.tool_settings
- if space_type == "VIEW_3D":
+ if space_type == 'VIEW_3D':
row = layout.row(align=True)
- row.prop(
- tool_settings, "annotation_stroke_placement_view3d", text="Placement"
- )
- if tool_settings.gpencil_stroke_placement_view3d == "CURSOR":
+ row.prop(tool_settings, "annotation_stroke_placement_view3d", text="Placement")
+ if tool_settings.gpencil_stroke_placement_view3d == 'CURSOR':
row.prop(tool_settings.gpencil_sculpt, "lockaxis")
- elif tool_settings.gpencil_stroke_placement_view3d in {"SURFACE", "STROKE"}:
+ elif tool_settings.gpencil_stroke_placement_view3d in {'SURFACE', 'STROKE'}:
row.prop(tool_settings, "use_gpencil_stroke_endpoints")
- elif space_type in {
- "IMAGE_EDITOR",
- "NODE_EDITOR",
- "SEQUENCE_EDITOR",
- "CLIP_EDITOR",
- }:
+ elif space_type in {'IMAGE_EDITOR', 'NODE_EDITOR', 'SEQUENCE_EDITOR', 'CLIP_EDITOR'}:
row = layout.row(align=True)
- row.prop(
- tool_settings, "annotation_stroke_placement_view2d", text="Placement"
- )
+ row.prop(tool_settings, "annotation_stroke_placement_view2d", text="Placement")
if tool.idname == "builtin.annotate_line":
props = tool.operator_properties("gpencil.annotate")
- if region_type == "TOOL_HEADER":
+ if region_type == 'TOOL_HEADER':
row = layout.row()
row.ui_units_x = 15
row.prop(props, "arrowstyle_start", text="Start")
@@ -201,7 +192,7 @@ class _defs_annotate:
col.prop(props, "arrowstyle_end", text="End")
elif tool.idname == "builtin.annotate":
props = tool.operator_properties("gpencil.annotate")
- if region_type == "TOOL_HEADER":
+ if region_type == 'TOOL_HEADER':
row = layout.row()
row.prop(props, "use_stabilizer", text="Stabilize Stroke")
subrow = layout.row(align=False)
@@ -221,10 +212,10 @@ class _defs_annotate:
idname="builtin.annotate",
label="Annotate",
icon="ops.gpencil.draw",
- cursor="PAINT_BRUSH",
+ cursor='PAINT_BRUSH',
keymap="Generic Tool: Annotate",
draw_settings=draw_settings,
- options={"KEYMAP_FALLBACK"},
+ options={'KEYMAP_FALLBACK'},
)
@ToolDef.from_fn.with_args(draw_settings=draw_settings_common)
@@ -233,10 +224,10 @@ class _defs_annotate:
idname="builtin.annotate_line",
label="Annotate Line",
icon="ops.gpencil.draw.line",
- cursor="PAINT_BRUSH",
+ cursor='PAINT_BRUSH',
keymap="Generic Tool: Annotate Line",
draw_settings=draw_settings,
- options={"KEYMAP_FALLBACK"},
+ options={'KEYMAP_FALLBACK'},
)
@ToolDef.from_fn.with_args(draw_settings=draw_settings_common)
@@ -245,10 +236,10 @@ class _defs_annotate:
idname="builtin.annotate_polygon",
label="Annotate Polygon",
icon="ops.gpencil.draw.poly",
- cursor="PAINT_BRUSH",
+ cursor='PAINT_BRUSH',
keymap="Generic Tool: Annotate Polygon",
draw_settings=draw_settings,
- options={"KEYMAP_FALLBACK"},
+ options={'KEYMAP_FALLBACK'},
)
@ToolDef.from_fn
@@ -257,21 +248,21 @@ class _defs_annotate:
# TODO: Move this setting to tool_settings
prefs = context.preferences
layout.prop(prefs.edit, "grease_pencil_eraser_radius", text="Radius")
-
return dict(
idname="builtin.annotate_eraser",
label="Annotate Eraser",
icon="ops.gpencil.draw.eraser",
- cursor="ERASER",
+ cursor='ERASER',
keymap="Generic Tool: Annotate Eraser",
draw_settings=draw_settings,
- options={"KEYMAP_FALLBACK"},
+ options={'KEYMAP_FALLBACK'},
)
class _defs_transform:
+
def draw_transform_sculpt_tool_settings(context, layout):
- if context.mode != "SCULPT":
+ if context.mode != 'SCULPT':
return
layout.prop(context.tool_settings.sculpt, "transform_mode")
@@ -279,10 +270,7 @@ class _defs_transform:
def translate():
def draw_settings(context, layout, _tool):
_defs_transform.draw_transform_sculpt_tool_settings(context, layout)
- _template_widget.VIEW3D_GGT_xform_gizmo.draw_settings_with_index(
- context, layout, 1
- )
-
+ _template_widget.VIEW3D_GGT_xform_gizmo.draw_settings_with_index(context, layout, 1)
return dict(
idname="builtin.move",
label="Move",
@@ -298,10 +286,7 @@ class _defs_transform:
def rotate():
def draw_settings(context, layout, _tool):
_defs_transform.draw_transform_sculpt_tool_settings(context, layout)
- _template_widget.VIEW3D_GGT_xform_gizmo.draw_settings_with_index(
- context, layout, 2
- )
-
+ _template_widget.VIEW3D_GGT_xform_gizmo.draw_settings_with_index(context, layout, 2)
return dict(
idname="builtin.rotate",
label="Rotate",
@@ -317,10 +302,7 @@ class _defs_transform:
def scale():
def draw_settings(context, layout, _tool):
_defs_transform.draw_transform_sculpt_tool_settings(context, layout)
- _template_widget.VIEW3D_GGT_xform_gizmo.draw_settings_with_index(
- context, layout, 3
- )
-
+ _template_widget.VIEW3D_GGT_xform_gizmo.draw_settings_with_index(context, layout, 3)
return dict(
idname="builtin.scale",
label="Scale",
@@ -335,10 +317,7 @@ class _defs_transform:
@ToolDef.from_fn
def scale_cage():
def draw_settings(context, layout, _tool):
- _template_widget.VIEW3D_GGT_xform_gizmo.draw_settings_with_index(
- context, layout, 3
- )
-
+ _template_widget.VIEW3D_GGT_xform_gizmo.draw_settings_with_index(context, layout, 3)
return dict(
idname="builtin.scale_cage",
label="Scale Cage",
@@ -353,10 +332,7 @@ class _defs_transform:
def shear():
def draw_settings(context, layout, _tool):
# props = tool.operator_properties("transform.shear")
- _template_widget.VIEW3D_GGT_xform_gizmo.draw_settings_with_index(
- context, layout, 2
- )
-
+ _template_widget.VIEW3D_GGT_xform_gizmo.draw_settings_with_index(context, layout, 2)
return dict(
idname="builtin.shear",
label="Shear",
@@ -374,7 +350,
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list