[Bf-blender-cvs] [b744f47eed0] greasepencil-object: Cleanup: Remove dead code, Fix incorrect labels, and Make things more Pythonic

Joshua Leung noreply at git.blender.org
Thu Jan 4 05:54:47 CET 2018


Commit: b744f47eed0e084b0a77196c458eeb73c2e57919
Author: Joshua Leung
Date:   Thu Jan 4 13:13:14 2018 +1300
Branches: greasepencil-object
https://developer.blender.org/rBb744f47eed0e084b0a77196c458eeb73c2e57919

Cleanup: Remove dead code, Fix incorrect labels, and Make things more Pythonic

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

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

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

diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index ab2c5c60a09..bca315ed926 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -1015,14 +1015,12 @@ class GPENCIL_MT_gpencil_draw_specials(Menu):
         layout.separator()
         palette = context.active_gpencil_palette
         brush = context.active_gpencil_brush
-        i = 0
-        for palcolor in palette.colors:
+        for i, palcolor in enumerate(palette.colors):
             if brush is None or brush.is_fill_only is False:
                 layout.operator("palette.palettecolor_choose", text=palcolor.name).index=i
             else:
                 if palcolor.fill_alpha > 0.0:
                     layout.operator("palette.palettecolor_choose", text=palcolor.name).index = i
-            i += 1
 
 
 class GPENCIL_MT_gpencil_vertex_group(Menu):
@@ -1153,7 +1151,7 @@ class GPENCIL_MT_layer_specials(Menu):
 
 
 class GPENCIL_MT_brush_specials(Menu):
-    bl_label = "Layer"
+    bl_label = "Brush"
 
     def draw(self, context):
         layout = self.layout
@@ -1162,13 +1160,14 @@ class GPENCIL_MT_brush_specials(Menu):
 
 
 class GPENCIL_MT_palettecolor_duplicate(Menu):
-    bl_label = "Layer"
+    bl_label = "Duplicate"
 
     def draw(self, context):
         layout = self.layout
 
         layout.operator_enum("palette.palettecolor_duplicate", "type")
 
+
 class GPENCIL_MT_palettecolor_specials(Menu):
     bl_label = "Layer"
 
@@ -1203,7 +1202,6 @@ class GreasePencilDataPanel:
 
     @classmethod
     def poll(cls, context):
-
         if context.gpencil_data is None:
             return False
 
@@ -1577,8 +1575,6 @@ class GreasePencilInfoPanel:
 
     @classmethod
     def poll(cls, context):
-        ts = context.scene.tool_settings
-
         if context.gpencil_data is None:
             return False



More information about the Bf-blender-cvs mailing list