[Bf-blender-cvs] [e32bcbd7e8b] sculpt-dev: Sculpt: face set extrude now kinda works

Joseph Eagar noreply at git.blender.org
Mon Oct 4 09:10:43 CEST 2021


Commit: e32bcbd7e8b0076a10f5897c1a4b207da971c938
Author: Joseph Eagar
Date:   Mon Oct 4 00:03:33 2021 -0700
Branches: sculpt-dev
https://developer.blender.org/rBe32bcbd7e8b0076a10f5897c1a4b207da971c938

Sculpt: face set extrude now kinda works

Face set extrude now mostly works, thought it's
still buggy and unstable in DynTopo mode.

Interfacing PBVH_BMESH with the BMOp API
turned out to have a few nasty gotchas; the last commit
fixed a lot of things but some rethinking of the basic
design still needs to happen.

===================================================================

M	release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M	source/blender/blenkernel/BKE_paint.h
M	source/blender/blenkernel/intern/dyntopo.c
M	source/blender/blenkernel/intern/paint.c
M	source/blender/bmesh/intern/bmesh_mesh.h
M	source/blender/bmesh/intern/bmesh_operators.c
M	source/blender/bmesh/intern/bmesh_structure.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/sculpt_paint/sculpt_face_set.c
M	source/blender/editors/sculpt_paint/sculpt_intern.h

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index b2460d50911..cea30041842 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -18,7 +18,8 @@
 
 # <pep8 compliant>
 
-# For documentation on tool definitions: see "bl_ui.space_toolsystem_common.ToolDef"
+# For documentation on tool definitions: see
+# "bl_ui.space_toolsystem_common.ToolDef"
 # where there are comments for each field and their use.
 
 # For now group all tools together
@@ -26,7 +27,6 @@
 #
 # For now keep this in a single file since it's an area that may change,
 # so avoid making changes all over the place.
-
 import bpy
 from bpy.types import Panel
 
@@ -42,34 +42,26 @@ def kmi_to_string_or_none(kmi):
     return kmi.to_string() if kmi else "<none>"
 
 
-def generate_from_enum_ex(
-        _context, *,
+def generate_from_enum_ex(_context, *,
         idname_prefix,
         icon_prefix,
         type,
         attr,
         cursor='DEFAULT',
         tooldef_keywords={},
-        exclude_filter={}
-):
+        exclude_filter={}):
     tool_defs = []
     for enum in type.bl_rna.properties[attr].enum_items_static:
         name = enum.name
         idname = enum.identifier
         if idname in exclude_filter:
             continue
-        tool_defs.append(
-            ToolDef.from_dict(
-                dict(
-                    idname=idname_prefix + name,
+        tool_defs.append(ToolDef.from_dict(dict(idname=idname_prefix + name,
                     label=name,
                     icon=icon_prefix + idname.lower(),
                     cursor=cursor,
                     data_block=idname,
-                    **tooldef_keywords,
-                )
-            )
-        )
+                    **tooldef_keywords,)))
     return tuple(tool_defs)
 
 
@@ -96,26 +88,20 @@ class _defs_view3d_generic:
             props = tool.operator_properties("view3d.cursor3d")
             layout.prop(props, "use_depth")
             layout.prop(props, "orientation")
-        return dict(
-            idname="builtin.cursor",
+        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
     def cursor_click():
-        return dict(
-            idname="builtin.none",
+        return dict(idname="builtin.none",
             label="None",
             icon="ops.generic.cursor",
-            keymap=(),
-        )
+            keymap=(),)
 
     @ToolDef.from_fn
     def ruler():
@@ -126,26 +112,20 @@ class _defs_view3d_generic:
             else:
                 kmi_add = None
                 kmi_remove = None
-            return tip_(
-                "Measure distance and angles.\n"
+            return tip_("Measure distance and angles.\n"
                 "\u2022 %s anywhere for new measurement.\n"
                 "\u2022 Drag ruler segment to measure an angle.\n"
                 "\u2022 %s to remove the active ruler.\n"
                 "\u2022 Ctrl while dragging to snap.\n"
-                "\u2022 Shift while dragging to measure surface thickness"
-            ) % (
-                kmi_to_string_or_none(kmi_add),
-                kmi_to_string_or_none(kmi_remove),
-            )
-        return dict(
-            idname="builtin.measure",
+                "\u2022 Shift while dragging to measure surface thickness") % (kmi_to_string_or_none(kmi_add),
+                kmi_to_string_or_none(kmi_remove),)
+        return dict(idname="builtin.measure",
             label="Measure",
             description=description,
             icon="ops.view3d.ruler",
             widget="VIEW3D_GGT_ruler",
             keymap="3D View Tool: Measure",
-            options={'KEYMAP_FALLBACK'},
-        )
+            options={'KEYMAP_FALLBACK'},)
 
 
 class _defs_annotate:
@@ -174,10 +154,8 @@ class _defs_annotate:
                     else:
                         sub = layout.row(align=True)
                         sub.prop(gpl, "color", text="")
-                    sub.popover(
-                        panel="TOPBAR_PT_annotation_layers",
-                        text=text,
-                    )
+                    sub.popover(panel="TOPBAR_PT_annotation_layers",
+                        text=text,)
                 else:
                     layout.prop(gpl, "color", text="")
 
@@ -232,39 +210,33 @@ class _defs_annotate:
 
     @ToolDef.from_fn.with_args(draw_settings=draw_settings_common)
     def scribble(*, draw_settings):
-        return dict(
-            idname="builtin.annotate",
+        return dict(idname="builtin.annotate",
             label="Annotate",
             icon="ops.gpencil.draw",
             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)
     def line(*, draw_settings):
-        return dict(
-            idname="builtin.annotate_line",
+        return dict(idname="builtin.annotate_line",
             label="Annotate Line",
             icon="ops.gpencil.draw.line",
             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)
     def poly(*, draw_settings):
-        return dict(
-            idname="builtin.annotate_polygon",
+        return dict(idname="builtin.annotate_polygon",
             label="Annotate Polygon",
             icon="ops.gpencil.draw.poly",
             cursor='PAINT_BRUSH',
             keymap="Generic Tool: Annotate Polygon",
             draw_settings=draw_settings,
-            options={'KEYMAP_FALLBACK'},
-        )
+            options={'KEYMAP_FALLBACK'},)
 
     @ToolDef.from_fn
     def eraser():
@@ -272,15 +244,13 @@ 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",
+        return dict(idname="builtin.annotate_eraser",
             label="Annotate Eraser",
             icon="ops.gpencil.draw.eraser",
             cursor='ERASER',
             keymap="Generic Tool: Annotate Eraser",
             draw_settings=draw_settings,
-            options={'KEYMAP_FALLBACK'},
-        )
+            options={'KEYMAP_FALLBACK'},)
 
 
 class _defs_transform:
@@ -296,76 +266,66 @@ class _defs_transform:
         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)
-        return dict(
-            idname="builtin.move",
+        return dict(idname="builtin.move",
             label="Move",
             # cursor='SCROLL_XY',
             icon="ops.transform.translate",
             widget="VIEW3D_GGT_xform_gizmo",
             operator="transform.translate",
             keymap="3D View Tool: Move",
-            draw_settings=draw_settings,
-        )
+            draw_settings=draw_settings,)
 
     @ToolDef.from_fn
     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)
-        return dict(
-            idname="builtin.rotate",
+        return dict(idname="builtin.rotate",
             label="Rotate",
             # cursor='SCROLL_XY',
             icon="ops.transform.rotate",
             widget="VIEW3D_GGT_xform_gizmo",
             operator="transform.rotate",
             keymap="3D View Tool: Rotate",
-            draw_settings=draw_settings,
-        )
+            draw_settings=draw_settings,)
 
     @ToolDef.from_fn
     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)
-        return dict(
-            idname="builtin.scale",
+        return dict(idname="builtin.scale",
             label="Scale",
             # cursor='SCROLL_XY',
             icon="ops.transform.resize",
             widget="VIEW3D_GGT_xform_gizmo",
             operator="transform.resize",
             keymap="3D View Tool: Scale",
-            draw_settings=draw_settings,
-        )
+            draw_settings=draw_settings,)
 
     @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)
-        return dict(
-            idname="builtin.scale_cage",
+        return dict(idname="builtin.scale_cage",
             label="Scale Cage",
             icon="ops.transform.resize.cage",
             widget="VIEW3D_GGT_xform_cage",
             operator="transform.resize",
             keymap="3D View Tool: Scale",
-            draw_settings=draw_settings,
-        )
+            draw_settings=draw_settings,)
 
     @ToolDef.from_fn
     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)
-        return dict(
-            idname="builtin.shear",
+   

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list