[Bf-blender-cvs] [da2955fdf66] master: UI: improve categorization in Grease Pencil Layers sub-panels

William Reynish noreply at git.blender.org
Mon Jan 25 13:41:58 CET 2021


Commit: da2955fdf66d9c232e3121be5713bcbd7a6c2ae1
Author: William Reynish
Date:   Mon Jan 25 23:39:20 2021 +1100
Branches: master
https://developer.blender.org/rBda2955fdf66d9c232e3121be5713bcbd7a6c2ae1

UI: improve categorization in Grease Pencil Layers sub-panels

The "Layers" panel for Grease Pencil objects uses sub-panels to organize
their properties in categories. Currently, this isn't so clear.
This patch cleans up these sub-panels with clearer categorization.

Reviewed By: #grease_pencil, antoniov, Blendify, HooglyBoogly

Ref D10184

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

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

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

diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py
index 0be5b86fb80..9db6eedb04c 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -23,6 +23,7 @@ from rna_prop_ui import PropertyPanel
 
 from bl_ui.properties_grease_pencil_common import (
     GreasePencilLayerMasksPanel,
+    GreasePencilLayerTransformPanel,
     GreasePencilLayerAdjustmentsPanel,
     GreasePencilLayerRelationsPanel,
     GreasePencilLayerDisplayPanel,
@@ -90,6 +91,7 @@ class GPENCIL_MT_layer_context_menu(Menu):
         layout = self.layout
         ob = context.object
         gpd = ob.data
+        gpl = gpd.layers.active
 
         layout.operator("gpencil.layer_duplicate", text="Duplicate", icon='DUPLICATE').mode='ALL'
         layout.operator("gpencil.layer_duplicate", text="Duplicate Empty Keyframes").mode='EMPTY'
@@ -104,6 +106,7 @@ class GPENCIL_MT_layer_context_menu(Menu):
         layout.operator("gpencil.lock_all", icon='LOCKED', text="Lock All")
         layout.operator("gpencil.unlock_all", icon='UNLOCKED', text="Unlock All")
         layout.prop(gpd, "use_autolock_layers", text="Autolock Inactive Layers")
+        layout.prop(gpl, "lock_material")
 
         layout.separator()
 
@@ -189,6 +192,12 @@ class DATA_PT_gpencil_layer_masks(LayerDataButtonsPanel, GreasePencilLayerMasksP
     bl_options = {'DEFAULT_CLOSED'}
 
 
+class DATA_PT_gpencil_layer_transform(LayerDataButtonsPanel, GreasePencilLayerTransformPanel, Panel):
+    bl_label = "Transform"
+    bl_parent_id = 'DATA_PT_gpencil_layers'
+    bl_options = {'DEFAULT_CLOSED'}
+
+
 class DATA_PT_gpencil_layer_adjustments(LayerDataButtonsPanel, GreasePencilLayerAdjustmentsPanel, Panel):
     bl_label = "Adjustments"
     bl_parent_id = 'DATA_PT_gpencil_layers'
@@ -425,6 +434,7 @@ classes = (
     DATA_PT_gpencil_onion_skinning_custom_colors,
     DATA_PT_gpencil_onion_skinning_display,
     DATA_PT_gpencil_layer_masks,
+    DATA_PT_gpencil_layer_transform,
     DATA_PT_gpencil_layer_adjustments,
     DATA_PT_gpencil_layer_relations,
     DATA_PT_gpencil_layer_display,
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 fecc09da539..67905192fe8 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -727,12 +727,32 @@ class GreasePencilSimplifyPanel:
         col.prop(rd, "simplify_gpencil_antialiasing")
 
 
+class GreasePencilLayerTransformPanel:
+
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+
+        ob = context.object
+        gpd = ob.data
+        gpl = gpd.layers.active
+        layout.active = not gpl.lock
+
+        row = layout.row(align=True)
+        row.prop(gpl, "location")
+
+        row = layout.row(align=True)
+        row.prop(gpl, "rotation")
+
+        row = layout.row(align=True)
+        row.prop(gpl, "scale")
+
+
 class GreasePencilLayerAdjustmentsPanel:
 
     def draw(self, context):
         layout = self.layout
         layout.use_property_split = True
-        scene = context.scene
 
         ob = context.object
         gpd = ob.data
@@ -750,25 +770,6 @@ class GreasePencilLayerAdjustmentsPanel:
         col = layout.row(align=True)
         col.prop(gpl, "line_change", text="Stroke Thickness")
 
-        col = layout.row(align=True)
-        col.prop(gpl, "pass_index")
-
-        col = layout.row(align=True)
-        col.prop_search(gpl, "viewlayer_render", scene, "view_layers", text="View Layer")
-
-        col = layout.row(align=True)
-        col.prop(gpl, "lock_material")
-
-        # Transforms
-        row = layout.row(align=True)
-        row.prop(gpl, "location")
-
-        row = layout.row(align=True)
-        row.prop(gpl, "rotation")
-
-        row = layout.row(align=True)
-        row.prop(gpl, "scale")
-
 
 class GPENCIL_UL_masks(UIList):
     def draw_item(self, _context, layout, _data, item, icon, _active_data, _active_propname, _index):
@@ -836,6 +837,7 @@ class GreasePencilLayerRelationsPanel:
         layout.use_property_split = True
         layout.use_property_decorate = False
 
+        scene = context.scene
         ob = context.object
         gpd = ob.data
         gpl = gpd.layers.active
@@ -849,6 +851,14 @@ class GreasePencilLayerRelationsPanel:
         if parent and gpl.parent_type == 'BONE' and parent.type == 'ARMATURE':
             col.prop_search(gpl, "parent_bone", parent.data, "bones", text="Bone")
 
+        layout.separator()
+
+        col = layout.row(align=True)
+        col.prop(gpl, "pass_index")
+
+        col = layout.row(align=True)
+        col.prop_search(gpl, "viewlayer_render", scene, "view_layers", text="View Layer")
+
 
 class GreasePencilLayerDisplayPanel:
 
diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py
index 0c222e8c023..aa98e4292f4 100644
--- a/release/scripts/startup/bl_ui/space_dopesheet.py
+++ b/release/scripts/startup/bl_ui/space_dopesheet.py
@@ -27,6 +27,7 @@ from bpy.types import (
 
 from bl_ui.properties_grease_pencil_common import (
     GreasePencilLayerMasksPanel,
+    GreasePencilLayerTransformPanel,
     GreasePencilLayerAdjustmentsPanel,
     GreasePencilLayerRelationsPanel,
     GreasePencilLayerDisplayPanel,
@@ -726,6 +727,12 @@ class DOPESHEET_PT_gpencil_layer_masks(LayersDopeSheetPanel, GreasePencilLayerMa
     bl_options = {'DEFAULT_CLOSED'}
 
 
+class DOPESHEET_PT_gpencil_layer_transform(LayersDopeSheetPanel, GreasePencilLayerTransformPanel, Panel):
+    bl_label = "Transform"
+    bl_parent_id = 'DOPESHEET_PT_gpencil_mode'
+    bl_options = {'DEFAULT_CLOSED'}
+
+
 class DOPESHEET_PT_gpencil_layer_adjustments(LayersDopeSheetPanel, GreasePencilLayerAdjustmentsPanel, Panel):
     bl_label = "Adjustments"
     bl_parent_id = 'DOPESHEET_PT_gpencil_mode'
@@ -762,6 +769,7 @@ classes = (
     DOPESHEET_PT_filters,
     DOPESHEET_PT_gpencil_mode,
     DOPESHEET_PT_gpencil_layer_masks,
+    DOPESHEET_PT_gpencil_layer_transform,
     DOPESHEET_PT_gpencil_layer_adjustments,
     DOPESHEET_PT_gpencil_layer_relations,
     DOPESHEET_PT_gpencil_layer_display,



More information about the Bf-blender-cvs mailing list