[Bf-blender-cvs] [3d4e14b7e19] sculpt-dev: Sculpt: various fixes
Joseph Eagar
noreply at git.blender.org
Wed Oct 6 01:52:41 CEST 2021
Commit: 3d4e14b7e19d97f851be37e1c42c9c5a18245706
Author: Joseph Eagar
Date: Tue Oct 5 16:50:37 2021 -0700
Branches: sculpt-dev
https://developer.blender.org/rB3d4e14b7e19d97f851be37e1c42c9c5a18245706
Sculpt: various fixes
* Fixed very nasty customdata bug where
if the first layer of a given type was
CD_TEMPORARY, then on being stripped out
of the customdata set the active references.
I think I tracked down where this happened, but
just to be safe I also wrote code to detect it and
regenerate the active refs too.
* Fixed rotate brush.
* Fixed mesh filter crashing with automasking on.
===================================================================
M release/scripts/startup/bl_ui/properties_paint_common.py
M source/blender/blenkernel/intern/brush_engine_presets.c
M source/blender/blenkernel/intern/customdata.c
M source/blender/blenkernel/intern/paint.c
M source/blender/blenkernel/intern/pbvh_bmesh.c
M source/blender/bmesh/intern/bmesh_construct.c
M source/blender/bmesh/intern/bmesh_log.c
M source/blender/bmesh/intern/bmesh_mesh_convert.c
M source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_vcol.cc
M source/blender/editors/sculpt_paint/sculpt.c
M source/blender/editors/sculpt_paint/sculpt_automasking.c
M source/blender/editors/sculpt_paint/sculpt_face_set.c
M source/blender/editors/sculpt_paint/sculpt_filter_mesh.c
M source/blender/editors/sculpt_paint/sculpt_intern.h
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index a2d00aeff99..812bfc01517 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -65,8 +65,7 @@ class DynamicBrushCategoryPanel(Panel):
if not ok:
continue
- UnifiedPaintPanel.channel_unified(
- layout,
+ UnifiedPaintPanel.channel_unified(layout,
context,
brush,
ch.idname,
@@ -145,7 +144,8 @@ class DynamicPaintPanelGen:
name = name2
for cls in classes[:]:
- #print("_", cls.bl_rna.identifier, cls.bl_rna.identifier == name) # r, dir(cls.bl_rna)) #.name)
+ #print("_", cls.bl_rna.identifier, cls.bl_rna.identifier == name) #
+ #r, dir(cls.bl_rna)) #.name)
if cls.bl_rna.identifier == name:
try:
@@ -471,7 +471,8 @@ class UnifiedPaintPanel:
row2.use_property_split = False
row2.use_property_decorate = False
- # replicate pre-existing functionality of direction showing up as +/- in the header
+ # replicate pre-existing functionality of direction showing up as
+ # +/- in the header
row2.prop_enum(finalch, typeprop, "ADD", text="")
row2.prop_enum(finalch, typeprop, "SUBTRACT", text="")
pass
@@ -486,13 +487,15 @@ class UnifiedPaintPanel:
row.prop(pressurech.mappings["PRESSURE"], "enabled", text="", icon="STYLUS_PRESSURE")
# if ch.is_color:
- # UnifiedPaintPanel.prop_unified_color_picker(row, context, brush, prop_name)
+ # UnifiedPaintPanel.prop_unified_color_picker(row, context, brush,
+ # prop_name)
# if pressure_name:
# row.prop(brush, pressure_name, text="")
# if unified_name and not header:
- # # NOTE: We don't draw UnifiedPaintSettings in the header to reduce clutter. D5928#136281
+ # # NOTE: We don't draw UnifiedPaintSettings in the header to reduce
+ # clutter. D5928#136281
# row.prop(ups, unified_name, text="", icon='BRUSHES_ALL')
if not header:
if ch.type == "BITMASK" and not toolsettings_only and ch == finalch:
@@ -551,8 +554,7 @@ class UnifiedPaintPanel:
return row
@staticmethod
- def prop_unified(
- layout,
+ def prop_unified(layout,
context,
brush,
prop_name,
@@ -562,8 +564,7 @@ class UnifiedPaintPanel:
text=None,
slider=False,
header=False,
- expand=None
- ):
+ expand=None):
""" Generalized way of adding brush options to the UI,
along with their pen pressure setting and global toggle, if they exist. """
@@ -572,7 +573,9 @@ class UnifiedPaintPanel:
prop_name = channel_name_map[prop_name]
if prop_name in brush.channels:
- # def channel_unified(layout, context, brush, prop_name, icon='NONE', pressure=True, text=None, slider=False, header=False):
+ # def channel_unified(layout, context, brush, prop_name,
+ # icon='NONE', pressure=True, text=None, slider=False,
+ # header=False):
return UnifiedPaintPanel.channel_unified(layout, context, brush, prop_name, icon=icon, text=text, slider=slider, header=header)
row = layout.row(align=True)
@@ -590,7 +593,8 @@ class UnifiedPaintPanel:
row.prop(brush, pressure_name, text="")
if unified_name and not header:
- # NOTE: We don't draw UnifiedPaintSettings in the header to reduce clutter. D5928#136281
+ # NOTE: We don't draw UnifiedPaintSettings in the header to reduce
+ # clutter. D5928#136281
row.prop(ups, unified_name, text="", icon='BRUSHES_ALL')
return row
@@ -620,7 +624,8 @@ class UnifiedPaintPanel:
parent.template_color_picker(prop_owner, prop_name, value_slider=value_slider)
-### Classes to let various paint modes' panels share code, by sub-classing these classes. ###
+### Classes to let various paint modes' panels share code, by sub-classing
+### these classes. ###
class BrushPanel(UnifiedPaintPanel):
@classmethod
def poll(cls, context):
@@ -718,22 +723,18 @@ class ClonePanel(BrushPanel):
if settings.mode == 'MATERIAL':
if len(ob.material_slots) > 1:
col.label(text="Materials")
- col.template_list(
- "MATERIAL_UL_matslots", "",
+ col.template_list("MATERIAL_UL_matslots", "",
ob, "material_slots",
ob, "active_material_index",
- rows=2,
- )
+ rows=2,)
mat = ob.active_material
if mat:
col.label(text="Source Clone Slot")
- col.template_list(
- "TEXTURE_UL_texpaintslots", "",
+ col.template_list("TEXTURE_UL_texpaintslots", "",
mat, "texture_paint_images",
mat, "paint_clone_slot",
- rows=2,
- )
+ rows=2,)
elif settings.mode == 'IMAGE':
mesh = ob.data
@@ -815,32 +816,26 @@ class StrokePanel(BrushPanel):
if brush.use_space:
row = col.row(align=True)
if mode == 'SCULPT':
- UnifiedPaintPanel.channel_unified(
- col,
+ UnifiedPaintPanel.channel_unified(col,
context,
brush,
- "spacing"
- )
+ "spacing")
else:
row.prop(brush, "spacing", text="Spacing")
row.prop(brush, "use_pressure_spacing", toggle=True, text="")
- UnifiedPaintPanel.channel_unified(
- col,
+ UnifiedPaintPanel.channel_unified(col,
context,
brush,
- "use_smoothed_rake"
- )
+ "use_smoothed_rake")
if brush.use_line or brush.use_curve:
row = col.row(align=True)
if mode == 'SCULPT':
- UnifiedPaintPanel.channel_unified(
- col,
+ UnifiedPaintPanel.channel_unified(col,
context,
brush,
- "spacing"
- )
+ "spacing")
else:
row.prop(brush, "spacing", text="Spacing")
@@ -852,12 +847,10 @@ class StrokePanel(BrushPanel):
col.prop(brush, "use_space_attenuation")
elif mode == 'SCULPT':
if brush.image_paint_capabilities.has_space_attenuation or brush.sculpt_capabilities.has_space_attenuation:
- UnifiedPaintPanel.channel_unified(
- col,
+ UnifiedPaintPanel.channel_unified(col,
context,
brush,
- "use_space_attenuation"
- )
+ "use_space_attenuation")
if brush.use_curve:
col.separator()
@@ -1000,30 +993,24 @@ class DisplayPanel(BrushPanel):
row = col.row(align=True)
row.prop(brush, "cursor_overlay_alpha", text="Falloff Opacity")
row.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
- row.prop(
- brush, "use_cursor_overlay", text="", toggle=True,
- icon='HIDE_OFF' if brush.use_cursor_overlay else 'HIDE_ON',
- )
+ row.prop(brush, "use_cursor_overlay", text="", toggle=True,
+ icon='HIDE_OFF' if brush.use_cursor_overlay else 'HIDE_ON',)
if mode in ['PAINT_2D', 'PAINT_TEXTURE', 'PAINT_VERTEX', 'SCULPT']:
row = col.row(align=True)
row.prop(brush, "texture_overlay_alpha", text="Texture Opacity")
row.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
if tex_slot.map_mode != 'STENCIL':
- row.prop(
- brush, "use_primary_overlay", text="", toggle=True,
- icon='HIDE_OFF' if brush.use_primary_overlay else 'HIDE_ON',
- )
+ row.prop(brush, "use_primary_overlay", text="", toggle=True,
+ icon='HIDE_OFF' if brush.use_primary_overlay else 'HIDE_ON',)
if mode in ['PAINT_TEXTURE', 'PAINT_2D']:
row = col.row(align=True)
row.prop(brush, "mask_overlay_alpha", text="Mask Texture Opacity")
row.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
if tex_slot_mask.map_mode != 'STENCIL':
- row.prop(
- brush, "use_secondary_overlay", text="", toggle=True,
- icon='HIDE_OFF' if brush.use_secondary_overlay else 'HIDE_ON',
- )
+ row.prop(brush, "use_secondary_overlay", text="", toggle=True,
+ icon='HIDE_OFF' if brush.use_secondary_overlay else 'HIDE_ON',)
class VIEW3D_MT_tools_projectpaint_clone(Menu):
@@ -1050,7 +1037,7 @@ def brush_settings(layout, context, brush, popover=False):
advanced = context.tool_settings.unified_paint_settings.brush_editor_advanced
editor = context.tool_settings.unified_paint_settings.brush_editor_mode
- ### Draw simple settings unique to each paint mode. ###
+ ### Draw simple settings unique to each paint mode. ###
brush_shared_settings(layout, context, brush, popover)
# Sculpt Mode #
@@ -1060,42 +1047,34 @@ def brush_settings(layout, context, brush, popover=False):
if advanced:
# normal_radius_factor
- UnifiedPaintPanel.prop_unified(
- layout,
+ UnifiedPaintPanel.prop_unified(layout,
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list