No need to count layers to check empty
authorCampbell Barton <ideasman42@gmail.com>
Thu, 6 Aug 2015 14:00:02 +0000 (00:00 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 6 Aug 2015 14:00:28 +0000 (00:00 +1000)
release/scripts/startup/bl_ui/properties_grease_pencil_common.py

index 9a46e6fa7a4e1dced8a0f61510f3d203987e0412..91a986d8e50fc7438082e58ba2e36e65de912205 100644 (file)
@@ -356,7 +356,7 @@ class GreasePencilDataPanel:
         layout.template_ID(gpd_owner, "grease_pencil", new="gpencil.data_add", unlink="gpencil.data_unlink")
 
         # Grease Pencil data...
-        if (gpd is None) or len(gpd.layers) == 0:
+        if (gpd is None) or (not gpd.layers):
             layout.operator("gpencil.layer_add", text="New Layer")
         else:
             self.draw_layers(context, layout, gpd)