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:
authorCampbell Barton <ideasman42@gmail.com>2018-09-04 11:30:22 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-09-04 11:31:02 +0300
commit765d1eadb99eaf8160e29c7b58f9540b4354bcdd (patch)
treeff5ebe425e9ab8f7b2af5b80371251497ace7acc /release
parent9b2e336cdf966028ac197a9e03c73de67164f88f (diff)
Fix error when no tool is active
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_topbar.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 82a04251ed5..06bdc9ee59e 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -110,16 +110,16 @@ class TOPBAR_HT_lower_bar(Header):
# Note: general mode options should be added to 'draw_right'.
if mode == 'SCULPT':
- if tool.has_datablock:
+ if (tool is not None) and tool.has_datablock:
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
elif mode == 'PAINT_VERTEX':
- if tool.has_datablock:
+ if (tool is not None) and tool.has_datablock:
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
elif mode == 'PAINT_WEIGHT':
- if tool.has_datablock:
+ if (tool is not None) and tool.has_datablock:
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
elif mode == 'PAINT_TEXTURE':
- if tool.has_datablock:
+ if (tool is not None) and tool.has_datablock:
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
elif mode == 'EDIT_ARMATURE':
pass
@@ -188,7 +188,7 @@ class TOPBAR_HT_lower_bar(Header):
class _draw_left_context_mode:
@staticmethod
def SCULPT(context, layout, tool):
- if not tool.has_datablock:
+ if (tool is None) or (not tool.has_datablock):
return
brush = context.tool_settings.sculpt.brush
if brush is None:
@@ -201,7 +201,7 @@ class _draw_left_context_mode:
layout.prop(brush, "direction", text="", expand=True)
def PAINT_TEXTURE(context, layout, tool):
- if not tool.has_datablock:
+ if (tool is None) or (not tool.has_datablock):
return
brush = context.tool_settings.vertex_paint.brush
if brush is None:
@@ -214,7 +214,7 @@ class _draw_left_context_mode:
UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength")
def PAINT_VERTEX(context, layout, tool):
- if not tool.has_datablock:
+ if (tool is None) or (not tool.has_datablock):
return
brush = context.tool_settings.vertex_paint.brush
if brush is None:
@@ -227,7 +227,7 @@ class _draw_left_context_mode:
UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength")
def PAINT_WEIGHT(context, layout, tool):
- if not tool.has_datablock:
+ if (tool is None) or (not tool.has_datablock):
return
brush = context.tool_settings.weight_paint.brush
if brush is None: