[Bf-blender-cvs] [17d035db098] greasepencil-object: UI: Change Onion and Parent panels

Antonio Vazquez noreply at git.blender.org
Wed Jun 6 17:23:00 CEST 2018


Commit: 17d035db098590a5a11f54cab4775d620ab60a45
Author: Antonio Vazquez
Date:   Wed Jun 6 17:22:45 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB17d035db098590a5a11f54cab4775d620ab60a45

UI: Change Onion and Parent panels

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

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 62f4f3314ea..66fb1e06112 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -123,6 +123,7 @@ class DATA_PT_gpencil_onionpanel(Panel):
         gpd = context.gpencil_data
 
         layout = self.layout
+        layout.use_property_split = True
         layout.enabled = gpd.use_onion_skinning
 
         GreasePencilOnionPanel.draw_settings(layout, gpd)
@@ -147,6 +148,7 @@ class DATA_PT_gpencil_layer_onionpanel(Panel):
         gpl = context.active_gpencil_layer
 
         layout = self.layout
+        layout.use_property_split = True
         layout.enabled = gpd.use_onion_skinning and gpl.override_onion
 
         GreasePencilOnionPanel.draw_settings(layout, gpl)
@@ -161,20 +163,17 @@ class DATA_PT_gpencil_parentpanel(LayerDataButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
-        scene = context.scene
-        gpl = context.active_gpencil_layer
-        row = layout.row()
+        layout.use_property_split = True
 
-        col = row.column(align=True)
+        gpl = context.active_gpencil_layer
+        col = layout.column(align=True)
         col.active = not gpl.lock
-        col.label(text="Parent:")
-        col.prop(gpl, "parent", text="")
-
-        sub = col.column()
-        sub.prop(gpl, "parent_type", text="")
+        col.prop(gpl, "parent", text="Parent")
+        col.prop(gpl, "parent_type", text="Parent Type")
         parent = gpl.parent
+
         if parent and gpl.parent_type == 'BONE' and parent.type == 'ARMATURE':
-            sub.prop_search(gpl, "parent_bone", parent.data, "bones", text="")
+            col.prop_search(gpl, "parent_bone", parent.data, "bones", text="Bone")
 
 
 class GPENCIL_UL_vgroups(UIList):
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 c808de4de26..4aa59778491 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -952,33 +952,32 @@ class GreasePencilDataPanel:
 class GreasePencilOnionPanel:
     @staticmethod
     def draw_settings(layout, gp):
-        col = layout.column(align=False)
-        col.row().prop(gp, "onion_mode", expand=True)
+        col = layout.column()
 
-        row = col.row()
-        row.prop(gp, "onion_factor", text="Opacity", slider=True)
-        sub = row.row(align=True)
+        row = col.row(align=True)
+        row.prop(gp, "onion_mode")
         icon = 'RESTRICT_RENDER_OFF' if gp.use_ghosts_always else 'RESTRICT_RENDER_ON'
-        sub.prop(gp, "use_ghosts_always", text="", icon=icon)
-        sub.prop(gp, "use_ghost_custom_colors", text="", icon='COLOR')
+        row.prop(gp, "use_ghosts_always", text="", icon=icon)
+        row.prop(gp, "use_ghost_custom_colors", text="", icon='COLOR')
 
-        split = layout.split(percentage=0.5)
+        row = col.row()
+        row.prop(gp, "onion_factor", text="Opacity", slider=True)
 
         # - Before Frames
-        sub = split.column(align=True)
+        sub = layout.column(align=True)
         row = sub.row(align=True)
         row.active = gp.use_ghost_custom_colors
-        row.prop(gp, "before_color", text="")
+        row.prop(gp, "before_color", text="Color Before")
 
-        row = sub.row(align=True)
+        row = layout.row(align=True)
         row.active = gp.onion_mode in ('ABSOLUTE', 'RELATIVE')
         row.prop(gp, "ghost_before_range", text="Before")
 
         # - After Frames
-        sub = split.column(align=True)
+        sub = layout.column(align=True)
         row = sub.row(align=True)
         row.active = gp.use_ghost_custom_colors
-        row.prop(gp, "after_color", text="")
+        row.prop(gp, "after_color", text="Color After")
 
         row = sub.row(align=True)
         row.active = gp.onion_mode in ('ABSOLUTE', 'RELATIVE')
@@ -989,7 +988,7 @@ class GreasePencilOnionPanel:
         row.active = gp.use_onion_skinning
         row.prop(gp, "use_onion_fade", text="Fade")
         if hasattr(gp, "use_onion_loop"): # XXX
-            subrow = row.row()
+            subrow = layout.row()
             subrow.active = gp.onion_mode in ('RELATIVE', 'SELECTED')
             subrow.prop(gp, "use_onion_loop", text="Loop")



More information about the Bf-blender-cvs mailing list