[Bf-blender-cvs] [ac33c2fc46e] greasepencil-object: Move Grease Pencil selector to top panel

Antonio Vazquez noreply at git.blender.org
Sat Jun 10 20:39:56 CEST 2017


Commit: ac33c2fc46ed9f5f428a1019307c0f3b9057cdf1
Author: Antonio Vazquez
Date:   Sat Jun 10 20:39:07 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBac33c2fc46ed9f5f428a1019307c0f3b9057cdf1

Move Grease Pencil selector to top panel

In order to keep UI consistency, the datablock must be in the top panel, not in layers

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

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

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

diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py
index a3abaca3524..891863062ed 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -31,18 +31,28 @@ class DataButtonsPanel:
 
     @classmethod
     def poll(cls, context):
-        return (context.object and context.object.type == 'GPENCIL')
+        return context.object and context.object.type == 'GPENCIL'
 
 
 class DATA_PT_gpencil(DataButtonsPanel, Panel):
-    bl_label = "Gpencil"
+    bl_label = "Grease Pencil"
 
     def draw(self, context):
         layout = self.layout
 
+        # Grease Pencil data selector
+        gpd_owner = context.gpencil_data_owner
+        gpd = context.gpencil_data
+
+        layout.template_ID(gpd_owner, "grease_pencil", new="gpencil.data_add", unlink="gpencil.data_unlink")
+        row = layout.row()
+        row.prop(gpd, "xray_mode", text="Draw Mode")
+        row.prop(gpd, "keep_stroke_thickness")
+
         ob = context.object
         layout.prop(ob, "empty_draw_size", text="Size")
 
+
 class DATA_PT_gpencil_datapanel(GreasePencilDataPanel, Panel):
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
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 88157e1f79d..1a4ce4aaa87 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -916,15 +916,13 @@ class GreasePencilDataPanel:
         if context.space_data.type == 'CLIP_EDITOR':
             layout.row().prop(context.space_data, "grease_pencil_source", expand=True)
         # Grease Pencil data selector
-        layout.template_ID(gpd_owner, "grease_pencil", new="gpencil.data_add", unlink="gpencil.data_unlink")
+        if context.space_data.type != 'PROPERTIES':
+            layout.template_ID(gpd_owner, "grease_pencil", new="gpencil.data_add", unlink="gpencil.data_unlink")
 
         # Grease Pencil data...
         if (gpd is None) or (not gpd.layers):
             layout.operator("gpencil.layer_add", text="New Layer")
         else:
-            row = layout.row()
-            row.prop(gpd, "xray_mode", text="Draw Mode")
-            row.prop(gpd, "keep_stroke_thickness")
             self.draw_layers(context, layout, gpd)
 
     def draw_layers(self, context, layout, gpd):




More information about the Bf-blender-cvs mailing list