Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2022-06-16 17:27:57 +0300
committerAntonio Vazquez <blendergit@gmail.com>2022-06-16 17:29:11 +0300
commite0c966a3b974fd0054aeb9524822f102db773381 (patch)
treebd85a42ed6d660a853a16b6ca017ef1f513693bf /release/scripts/startup/bl_ui/space_view3d.py
parent49b068bc639ce5e16a8d700beff2902ed266b74e (diff)
Fix T98904: GPencil sculpt brushes break after you delete a brush
There were two problems here: 1) Console warnings due to brush was None. 2) It was impossible to recreate a brush. This patch fixes both issues and it is now possible to recreate any brush. Differential Revision: https://developer.blender.org/D15213 Reviewed by: @dflelinto
Diffstat (limited to 'release/scripts/startup/bl_ui/space_view3d.py')
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 80ea33f8a75..5e5e7a79035 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -95,7 +95,7 @@ class VIEW3D_HT_tool_header(Header):
elif tool_mode == 'PAINT_GPENCIL':
if is_valid_context:
brush = context.tool_settings.gpencil_paint.brush
- if brush.gpencil_tool != 'ERASE':
+ if brush and brush.gpencil_tool != 'ERASE':
if brush.gpencil_tool != 'TINT':
layout.popover("VIEW3D_PT_tools_grease_pencil_brush_advanced")
@@ -106,10 +106,11 @@ class VIEW3D_HT_tool_header(Header):
elif tool_mode == 'SCULPT_GPENCIL':
if is_valid_context:
brush = context.tool_settings.gpencil_sculpt_paint.brush
- tool = brush.gpencil_sculpt_tool
- if tool != 'CLONE':
- layout.popover("VIEW3D_PT_tools_grease_pencil_sculpt_brush_popover")
- layout.popover("VIEW3D_PT_tools_grease_pencil_sculpt_appearance")
+ if brush:
+ tool = brush.gpencil_sculpt_tool
+ if tool != 'CLONE':
+ layout.popover("VIEW3D_PT_tools_grease_pencil_sculpt_brush_popover")
+ layout.popover("VIEW3D_PT_tools_grease_pencil_sculpt_appearance")
elif tool_mode == 'WEIGHT_GPENCIL':
if is_valid_context:
layout.popover("VIEW3D_PT_tools_grease_pencil_weight_appearance")