[Bf-blender-cvs] [2e3e10cc959] sculpt-dev: Sculpt: add option to fade face sets with a Moire pattern instead of transparently.

Joseph Eagar noreply at git.blender.org
Fri Oct 22 14:03:08 CEST 2021


Commit: 2e3e10cc95998a42962208289af45f7086c93d4a
Author: Joseph Eagar
Date:   Fri Oct 22 05:01:08 2021 -0700
Branches: sculpt-dev
https://developer.blender.org/rB2e3e10cc95998a42962208289af45f7086c93d4a

Sculpt: add option to fade face sets with a
        Moire pattern instead of transparently.

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

M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/blenloader/intern/versioning_300.c
M	source/blender/draw/engines/overlay/overlay_sculpt.c
M	source/blender/draw/engines/overlay/shaders/sculpt_mask_frag.glsl
M	source/blender/draw/engines/overlay/shaders/sculpt_mask_vert.glsl
M	source/blender/makesdna/DNA_view3d_defaults.h
M	source/blender/makesdna/DNA_view3d_types.h
M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index c1b37fbf13f..1a1cdec3258 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -59,10 +59,8 @@ class VIEW3D_HT_tool_header(Header):
         # Active Tool
         # -----------
         from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
-        tool = ToolSelectPanelHelper.draw_active_tool_header(
-            context, layout,
-            tool_key=('VIEW_3D', tool_mode),
-        )
+        tool = ToolSelectPanelHelper.draw_active_tool_header(context, layout,
+            tool_key=('VIEW_3D', tool_mode),)
         # Object Mode Options
         # -------------------
 
@@ -106,7 +104,8 @@ class VIEW3D_HT_tool_header(Header):
         elif tool_mode == 'POSE':
             pass
         elif tool_mode == 'PARTICLE':
-            # Disable, only shows "Brush" panel, which is already in the top-bar.
+            # Disable, only shows "Brush" panel, which is already in the
+            # top-bar.
             # if tool.has_datablock:
             #     layout.popover_group(context=".paint_common", **popover_kw)
             pass
@@ -212,10 +211,8 @@ class VIEW3D_HT_tool_header(Header):
             layout.label(text="Layer:")
             sub = layout.row()
             sub.ui_units_x = 8
-            sub.popover(
-                panel="TOPBAR_PT_gpencil_layers",
-                text=text,
-            )
+            sub.popover(panel="TOPBAR_PT_gpencil_layers",
+                text=text,)
 
 
 class _draw_tool_settings_context_mode:
@@ -249,8 +246,7 @@ class _draw_tool_settings_context_mode:
         if size_owner.use_locked_size == 'SCENE':
             size = "unprojected_radius"
 
-        UnifiedPaintPanel.prop_unified(
-            layout,
+        UnifiedPaintPanel.prop_unified(layout,
             context,
             brush,
             size,
@@ -258,28 +254,24 @@ class _draw_tool_settings_context_mode:
             unified_name="use_unified_size",
             text="Radius",
             slider=True,
-            header=True
-        )
+            header=True)
 
         # strength, use_strength_pressure
         pressure_name = "use_pressure_strength" if capabilities.has_strength_pressure else None
-        UnifiedPaintPanel.prop_unified(
-            layout,
+        UnifiedPaintPanel.prop_unified(layout,
             context,
             brush,
             "strength",
             pressure_name=pressure_name,
             unified_name="use_unified_strength",
             text="Strength",
-            header=True
-        )
+            header=True)
 
         # direction
         if not capabilities.has_direction:
             row = layout.row()
 
-            UnifiedPaintPanel.prop_unified(
-                layout,
+            UnifiedPaintPanel.prop_unified(layout,
                 context,
                 brush,
                 "direction",
@@ -287,8 +279,7 @@ class _draw_tool_settings_context_mode:
                 unified_name="use_unified_strength",
                 text="",
                 header=True,
-                expand=True
-            )
+                expand=True)
 
         if capabilities.has_color:
             #note we swap the labels here so users don't get confused.
@@ -349,18 +340,15 @@ class _draw_tool_settings_context_mode:
 
         capabilities = brush.weight_paint_capabilities
         if capabilities.has_weight:
-            UnifiedPaintPanel.prop_unified(
-                layout,
+            UnifiedPaintPanel.prop_unified(layout,
                 context,
                 brush,
                 "weight",
                 unified_name="use_unified_weight",
                 slider=True,
-                header=True
-            )
+                header=True)
 
-        UnifiedPaintPanel.prop_unified(
-            layout,
+        UnifiedPaintPanel.prop_unified(layout,
             context,
             brush,
             "size",
@@ -368,17 +356,14 @@ class _draw_tool_settings_context_mode:
             unified_name="use_unified_size",
             slider=True,
             text="Radius",
-            header=True
-        )
-        UnifiedPaintPanel.prop_unified(
-            layout,
+            header=True)
+        UnifiedPaintPanel.prop_unified(layout,
             context,
             brush,
             "strength",
             pressure_name="use_pressure_strength",
             unified_name="use_unified_strength",
-            header=True
-        )
+            header=True)
 
         return True
 
@@ -521,10 +506,7 @@ class VIEW3D_HT_header(Header):
     def draw_xform_template(layout, context):
         obj = context.active_object
         object_mode = 'OBJECT' if obj is None else obj.mode
-        has_pose_mode = (
-            (object_mode == 'POSE') or
-            (object_mode == 'WEIGHT_PAINT' and context.pose_object is not None)
-        )
+        has_pose_mode = ((object_mode == 'POSE') or (object_mode == 'WEIGHT_PAINT' and context.pose_object is not None))
 
         tool_settings = context.tool_settings
 
@@ -538,12 +520,10 @@ class VIEW3D_HT_header(Header):
 
             sub = row.row()
             sub.ui_units_x = 4
-            sub.prop_with_popover(
-                orient_slot,
+            sub.prop_with_popover(orient_slot,
                 "type",
                 text="",
-                panel="VIEW3D_PT_transform_orientations",
-            )
+                panel="VIEW3D_PT_transform_orientations",)
 
         # Pivot
         if object_mode in {'OBJECT', 'EDIT', 'EDIT_GPENCIL', 'SCULPT_GPENCIL'} or has_pose_mode:
@@ -585,11 +565,9 @@ class VIEW3D_HT_header(Header):
             row.prop(tool_settings, "use_snap", text="")
 
             sub = row.row(align=True)
-            sub.popover(
-                panel="VIEW3D_PT_snapping",
+            sub.popover(panel="VIEW3D_PT_snapping",
                 icon=icon,
-                text=text,
-            )
+                text=text,)
 
         # Proportional editing
         if object_mode in {'EDIT', 'PARTICLE_EDIT', 'SCULPT_GPENCIL', 'EDIT_GPENCIL', 'OBJECT'}:
@@ -613,13 +591,11 @@ class VIEW3D_HT_header(Header):
             row.prop(tool_settings, attr, icon_only=True, **kw)
             sub = row.row(align=True)
             sub.active = getattr(tool_settings, attr)
-            sub.prop_with_popover(
-                tool_settings,
+            sub.prop_with_popover(tool_settings,
                 "proportional_edit_falloff",
                 text="",
                 icon_only=True,
-                panel="VIEW3D_PT_proportional_edit",
-            )
+                panel="VIEW3D_PT_proportional_edit",)
 
     def draw(self, context):
         layout = self.layout
@@ -634,27 +610,26 @@ class VIEW3D_HT_header(Header):
         obj = context.active_object
         # mode_string = context.mode
         object_mode = 'OBJECT' if obj is None else obj.mode
-        has_pose_mode = (
-            (object_mode == 'POSE') or
-            (object_mode == 'WEIGHT_PAINT' and context.pose_object is not None)
-        )
+        has_pose_mode = ((object_mode == 'POSE') or (object_mode == 'WEIGHT_PAINT' and context.pose_object is not None))
 
-        # Note: This is actually deadly in case enum_items have to be dynamically generated
-        #       (because internal RNA array iterator will free everything immediately...).
+        # Note: This is actually deadly in case enum_items have to be
+        # dynamically generated
+        #       (because internal RNA array iterator will free everything
+        #       immediately...).
         # XXX This is an RNA internal issue, not sure how to fix it.
-        # Note: Tried to add an accessor to get translated UI strings instead of manual call
-        #       to pgettext_iface below, but this fails because translated enumitems
+        # Note: Tried to add an accessor to get translated UI strings instead
+        # of manual call
+        #       to pgettext_iface below, but this fails because translated
+        #       enumitems
         #       are always dynamically allocated.
         act_mode_item = bpy.types.Object.bl_rna.properties["mode"].enum_items[object_mode]
         act_mode_i18n_context = bpy.types.Object.bl_rna.properties["mode"].translation_context
 
         sub = row.row(align=True)
         sub.ui_units_x = 5.5
-        sub.operator_menu_enum(
-            "object.mode_set", "mode",
+        sub.operator_menu_enum("object.mode_set", "mode",
             text=bpy.app.translations.pgettext_iface(act_mode_item.name, act_mode_i18n_context),
-            icon=act_mode_item.icon,
-        )
+            icon=act_mode_item.icon,)
         del act_mode_item
 
         layout.template_header_3D_mode()
@@ -697,10 +672,8 @@ class VIEW3D_HT_header(Header):
                          icon='IPO_BEZIER')
                 sub = row.row(align=True)
                 sub.active = gpd.use_curve_edit
-                sub.popover(
-                    panel="VIEW3D_PT_gpencil_curve_edit",
-                    text="Curve Editing",
-                )
+                sub.popover(panel="VIEW3D_PT_gpencil_curve_edit",
+                    text="Curve Editing",)
 
             # Select mode for Sculpt
             if gpd.is_stroke_sculpt_mode:
@@ -720,21 +693,14 @@ class VIEW3D_HT_header(Header):
                 row = layout.row(align=True)
                 row.prop(gpd, "use_multiedit", text="", icon='GP_MULTIFRAME_EDITING')
 
-            if (
-                    gpd.use_stroke_edit_mode or
-                    gpd.is_stroke_sculpt_mode or
-                    gpd.is_stroke_weight_mode or
-                    gpd.is_stroke_vertex_mode
-            ):
+            if (gpd.use_stroke_edit_mode or gpd.is_stroke_sculpt_mode or gpd.is_stroke_weight_mode or gpd.is_stroke_vertex_mode):
                 row = layout.row(align=True)
                 row.prop(gpd, "use_multiedit", text="", icon='GP_MULTIFRAME_EDITING')
 
                 sub = row.row(align=True)
                 sub.enabled = gpd.use_multiedit
-                sub.popover(
-                    panel="VIEW3D_PT_gpencil_mult

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list