[Bf-blender-cvs] [41053deba4d] master: GPencil: Avoid console warnings when no Sculpt brush selected

Antonio Vazquez noreply at git.blender.org
Wed Jun 15 13:30:31 CEST 2022


Commit: 41053deba4d305f753d73b0ece68cfe1f6dd4ab2
Author: Antonio Vazquez
Date:   Wed Jun 15 13:30:14 2022 +0200
Branches: master
https://developer.blender.org/rB41053deba4d305f753d73b0ece68cfe1f6dd4ab2

GPencil: Avoid console warnings when no Sculpt brush selected

If the brush is deleted, the panel must not be filled.

To recreate the missing Brush is necessary to use `Reset All`

This fix part of T98904

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

M	release/scripts/startup/bl_ui/properties_paint_common.py

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

diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index 5a9a8882bd9..68a7e2b4527 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -1317,6 +1317,8 @@ def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False)
 
 def brush_basic_gpencil_sculpt_settings(layout, _context, brush, *, compact=False):
     gp_settings = brush.gpencil_settings
+    if gp_settings is None:
+        return
     tool = brush.gpencil_sculpt_tool
 
     row = layout.row(align=True)



More information about the Bf-blender-cvs mailing list