[Bf-blender-cvs] [a472ced73be] temp-sculpt-normals-masking: temp-sculpt-normals-masking: Support normals automasking for sculpt filters
Joseph Eagar
noreply at git.blender.org
Sun Jul 17 00:09:49 CEST 2022
Commit: a472ced73bed0500910467cf4919346ff2ba6e35
Author: Joseph Eagar
Date: Sat Jul 16 15:08:18 2022 -0700
Branches: temp-sculpt-normals-masking
https://developer.blender.org/rBa472ced73bed0500910467cf4919346ff2ba6e35
temp-sculpt-normals-masking: Support normals automasking for sculpt
filters
* Sculpt filters now sample the area normal on first click.
* Small cleanup: there is now a utility function for defining common
filter operator properties, SCULPT_mesh_filter_properties.
* Filters now update the last location (used for e.g. view centering).
===================================================================
M release/datafiles/locale
M release/scripts/addons
M release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M source/blender/blenkernel/BKE_paint.h
M source/blender/editors/include/ED_sculpt.h
M source/blender/editors/sculpt_paint/sculpt_automasking.cc
M source/blender/editors/sculpt_paint/sculpt_cloth.c
M source/blender/editors/sculpt_paint/sculpt_filter_color.c
M source/blender/editors/sculpt_paint/sculpt_filter_mesh.c
M source/blender/editors/sculpt_paint/sculpt_intern.h
M source/blender/editors/sculpt_paint/sculpt_transform.c
M source/blender/editors/transform/transform_convert_sculpt.c
M source/tools
===================================================================
diff --git a/release/datafiles/locale b/release/datafiles/locale
index 9a85b137951..a2eb5078914 160000
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 9a85b13795157560b319235c63f5a13b0107ba41
+Subproject commit a2eb507891449a0b67582be9561840075513661d
diff --git a/release/scripts/addons b/release/scripts/addons
index bdf75cb276d..7a8502871c3 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit bdf75cb276dfd3b5266c909de4c099c00c68a659
+Subproject commit 7a8502871c34db0343cc7de52d6b49b15a84238a
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 02abbd43986..59fed44aec8 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -25,14 +25,15 @@ 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:
@@ -78,16 +79,15 @@ 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,6 +119,7 @@ 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",
@@ -126,12 +127,11 @@ 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,21 +166,30 @@ 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")
@@ -192,7 +201,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)
@@ -212,10 +221,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)
@@ -224,10 +233,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)
@@ -236,10 +245,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
@@ -248,21 +257,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")
@@ -270,7 +279,10 @@ 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",
@@ -286,7 +298,10 @@ 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",
@@ -302,7 +317,10 @@ 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",
@@ -317,7 +335,10 @@ 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(
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list