diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-28 15:43:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-28 15:43:11 +0400 |
commit | 46aea9c0c8969a3cacdda9d43ed3b8596ed725e9 (patch) | |
tree | 7fbebb461347496cd847afad659a96570e0ddd14 /release | |
parent | 6864f2c2857e37e7a1c4f2d8a471c17e8e63e4db (diff) |
patch [#36296] object->display-properties subpanel layout cleanup
from David Jeske (jeske), with minor edits of my own.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_object.py | 57 |
1 files changed, 35 insertions, 22 deletions
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index 31023d49340..b8a8bedf722 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -203,41 +203,54 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel): def draw(self, context): layout = self.layout - obj = context.object + obj_type = obj.type + is_geometry = (obj_type in {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT'}) + is_empty_image = (obj_type == 'EMPTY' and obj.empty_draw_type == 'IMAGE') - split = layout.split() - col = split.column() - col.prop(obj, "draw_type", text="Type") - - col = split.column() - row = col.row() - row.prop(obj, "show_bounds", text="Bounds") - sub = row.row() - sub.active = obj.show_bounds - sub.prop(obj, "draw_bounds_type", text="") - + # start top half split = layout.split() + # left column checkboxes col = split.column() col.prop(obj, "show_name", text="Name") col.prop(obj, "show_axis", text="Axis") - - obj_type = obj.type - - if obj_type in {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT'}: + if is_geometry: # Makes no sense for cameras, armtures, etc.! col.prop(obj, "show_wire", text="Wire") - # Only useful with object having faces/materials... - col.prop(obj, "color", text="Object Color") + if obj_type == 'MESH': + col.prop(obj, "show_all_edges") + # right column checkboxes col = split.column() - col.prop(obj, "show_texture_space", text="Texture Space") + if 1: # for code nesting clarity + row = col.row() + row.prop(obj, "show_bounds", text="Bounds") + sub = row.row() + sub.active = obj.show_bounds + sub.prop(obj, "draw_bounds_type", text="") + + if is_geometry: + col.prop(obj, "show_texture_space", text="Texture Space") col.prop(obj, "show_x_ray", text="X-Ray") - if obj_type == 'MESH' or (obj_type == 'EMPTY' and obj.empty_draw_type == 'IMAGE'): + if obj_type == 'MESH' or is_empty_image: col.prop(obj, "show_transparent", text="Transparency") - if obj_type == 'MESH': - col.prop(obj, "show_all_edges") + + # start bottom half + split = layout.split() + + # left + col = split.column() + if obj_type not in {'CAMERA', 'EMPTY'}: + col.label(text="Maximum draw type:") + col.prop(obj, "draw_type", text="") + + # right + col = split.column() + if is_geometry or is_empty_image: + # Only useful with object having faces/materials... + col.label(text="Object Color:") + col.prop(obj, "color", text="") class OBJECT_PT_duplication(ObjectButtonsPanel, Panel): |