GPv3: Sculpt Advanced panel is displayed empty

Only smooth and randomize brush has properties in advanced panel. For
others, panel is empty. Include condition in poll function to skip
drawing of "advanced" panel for rest brushes

Resolves #123536

Pull Request: https://projects.blender.org/blender/blender/pulls/123549
This commit is contained in:
Pratik Borhade
2024-06-24 13:54:54 +02:00
committed by Pratik Borhade
parent 371e419aa4
commit bba375c785
2 changed files with 10 additions and 6 deletions

View File

@@ -1075,12 +1075,11 @@ def brush_settings_advanced(layout, context, brush, popover=False):
tool = brush.gpencil_sculpt_tool
gp_settings = brush.gpencil_settings
if tool in {'SMOOTH', 'RANDOMIZE'}:
col = layout.column(heading="Affect", align=True)
col.prop(gp_settings, "use_edit_position", text="Position")
col.prop(gp_settings, "use_edit_strength", text="Strength")
col.prop(gp_settings, "use_edit_thickness", text="Thickness")
col.prop(gp_settings, "use_edit_uv", text="UV")
col = layout.column(heading="Affect", align=True)
col.prop(gp_settings, "use_edit_position", text="Position")
col.prop(gp_settings, "use_edit_strength", text="Strength")
col.prop(gp_settings, "use_edit_thickness", text="Thickness")
col.prop(gp_settings, "use_edit_uv", text="UV")
# 3D and 2D Texture Paint.
elif mode in {'PAINT_TEXTURE', 'PAINT_2D'}:

View File

@@ -394,6 +394,11 @@ class VIEW3D_PT_tools_brush_settings_advanced(Panel, View3DPaintBrushPanel):
@classmethod
def poll(cls, context):
mode = cls.get_brush_mode(context)
if mode == 'SCULPT_GREASE_PENCIL':
settings = cls.paint_settings(context)
tool = settings.brush.gpencil_sculpt_tool
return tool in {'SMOOTH', 'RANDOMIZE'}
return mode is not None and mode != 'SCULPT_CURVES'
def draw(self, context):