[Bf-blender-cvs] [4503c96a175] blender2.8: Cleanup: remove redundant checks
Campbell Barton
noreply at git.blender.org
Tue Nov 13 07:05:01 CET 2018
Commit: 4503c96a175596bf5c0a52508a162dd78bcb9cdc
Author: Campbell Barton
Date: Tue Nov 13 17:04:57 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB4503c96a175596bf5c0a52508a162dd78bcb9cdc
Cleanup: remove redundant checks
===================================================================
M release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index affb5439af1..3fa27bd4d26 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1385,22 +1385,20 @@ class _defs_gpencil_edit:
class _defs_gpencil_sculpt:
def draw_settings_common(context, layout, tool):
- ob = context.active_object
- if ob and ob.mode == 'GPENCIL_SCULPT':
- tool_settings = context.tool_settings
- settings = tool_settings.gpencil_sculpt
- tool = settings.sculpt_tool
- brush = settings.brush
+ tool_settings = context.tool_settings
+ settings = tool_settings.gpencil_sculpt
+ tool = settings.sculpt_tool
+ brush = settings.brush
- layout.prop(brush, "size", slider=True)
+ layout.prop(brush, "size", slider=True)
- row = layout.row(align=True)
- row.prop(brush, "strength", slider=True)
- row.prop(brush, "use_pressure_strength", text="")
+ row = layout.row(align=True)
+ row.prop(brush, "strength", slider=True)
+ row.prop(brush, "use_pressure_strength", text="")
- if tool in {'THICKNESS', 'STRENGTH', 'PINCH', 'TWIST'}:
- row.separator()
- row.prop(brush, "direction", expand=True, text="")
+ if tool in {'THICKNESS', 'STRENGTH', 'PINCH', 'TWIST'}:
+ row.separator()
+ row.prop(brush, "direction", expand=True, text="")
@staticmethod
def generate_from_brushes(context):
@@ -1418,16 +1416,14 @@ class _defs_gpencil_sculpt:
class _defs_gpencil_weight:
def draw_settings_common(context, layout, tool):
- ob = context.active_object
- if ob and ob.mode == 'GPENCIL_WEIGHT':
- settings = context.tool_settings.gpencil_sculpt
- brush = settings.brush
+ settings = context.tool_settings.gpencil_sculpt
+ brush = settings.brush
- layout.prop(brush, "size", slider=True)
+ layout.prop(brush, "size", slider=True)
- row = layout.row(align=True)
- row.prop(brush, "strength", slider=True)
- row.prop(brush, "use_pressure_strength", text="")
+ row = layout.row(align=True)
+ row.prop(brush, "strength", slider=True)
+ row.prop(brush, "use_pressure_strength", text="")
@staticmethod
def generate_from_brushes(context):
More information about the Bf-blender-cvs
mailing list