[Bf-blender-cvs] [acb576c762d] master: UI: Empty image Properties layout tweaks

William Reynish noreply at git.blender.org
Tue Jan 28 10:25:48 CET 2020


Commit: acb576c762d46d945e1bafe85d3f166c6c07955b
Author: William Reynish
Date:   Tue Jan 28 10:25:46 2020 +0100
Branches: master
https://developer.blender.org/rBacb576c762d46d945e1bafe85d3f166c6c07955b

UI: Empty image Properties layout tweaks

  - Enable decorators
  - Use sub-panel for transparency

Differential Revision: https://developer.blender.org/D6692

Reviewed by Brecht van Lommel

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

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

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

diff --git a/release/scripts/startup/bl_ui/properties_data_empty.py b/release/scripts/startup/bl_ui/properties_data_empty.py
index dc9c170c65b..d686c55407a 100644
--- a/release/scripts/startup/bl_ui/properties_data_empty.py
+++ b/release/scripts/startup/bl_ui/properties_data_empty.py
@@ -37,7 +37,6 @@ class DATA_PT_empty(DataButtonsPanel, Panel):
     def draw(self, context):
         layout = self.layout
         layout.use_property_split = True
-        layout.use_property_decorate = False
 
         ob = context.object
 
@@ -45,12 +44,6 @@ class DATA_PT_empty(DataButtonsPanel, Panel):
         layout.prop(ob, "empty_display_size", text="Size")
 
         if ob.empty_display_type == 'IMAGE':
-            layout.prop(ob, "use_empty_image_alpha")
-
-            col = layout.column()
-            col.active = ob.use_empty_image_alpha
-            col.prop(ob, "color", text="Opacity", index=3, slider=True)
-
             col = layout.column(align=True)
             col.prop(ob, "empty_image_offset", text="Offset X", index=0)
             col.prop(ob, "empty_image_offset", text="Y", index=1)
@@ -58,11 +51,32 @@ class DATA_PT_empty(DataButtonsPanel, Panel):
             col = layout.column()
             col.row().prop(ob, "empty_image_depth", text="Depth", expand=True)
             col.row().prop(ob, "empty_image_side", text="Side", expand=True)
-            col.prop(ob, "show_empty_image_orthographic", text="Display Orthographic")
-            col.prop(ob, "show_empty_image_perspective", text="Display Perspective")
+            col.prop(ob, "show_empty_image_orthographic",
+                     text="Display Orthographic")
+            col.prop(ob, "show_empty_image_perspective",
+                     text="Display Perspective")
             col.prop(ob, "show_empty_image_only_axis_aligned")
 
 
+class DATA_PT_empty_alpha(DataButtonsPanel, Panel):
+    bl_label = "Transparency"
+    bl_parent_id = "DATA_PT_empty"
+
+    def draw_header(self, context):
+        ob = context.object
+
+        self.layout.prop(ob, "use_empty_image_alpha", text="")
+
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+
+        ob = context.object
+
+        layout.active = ob.use_empty_image_alpha
+        layout.prop(ob, "color", text="Opacity", index=3, slider=True)
+
+
 class DATA_PT_empty_image(DataButtonsPanel, Panel):
     bl_label = "Image"
 
@@ -74,13 +88,15 @@ class DATA_PT_empty_image(DataButtonsPanel, Panel):
     def draw(self, context):
         layout = self.layout
         ob = context.object
-        layout.template_ID(ob, "data", open="image.open", unlink="object.unlink_data")
+        layout.template_ID(ob, "data", open="image.open",
+                           unlink="object.unlink_data")
         layout.separator()
         layout.template_image(ob, "data", ob.image_user, compact=True)
 
 
 classes = (
     DATA_PT_empty,
+    DATA_PT_empty_alpha,
     DATA_PT_empty_image,
 )



More information about the Bf-blender-cvs mailing list