[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58692] trunk/blender/release/scripts/ startup/bl_ui/properties_object.py: patch [#36296] object-> display-properties subpanel layout cleanup
Campbell Barton
ideasman42 at gmail.com
Sun Jul 28 13:43:11 CEST 2013
Revision: 58692
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58692
Author: campbellbarton
Date: 2013-07-28 11:43:11 +0000 (Sun, 28 Jul 2013)
Log Message:
-----------
patch [#36296] object->display-properties subpanel layout cleanup
from David Jeske (jeske), with minor edits of my own.
Modified Paths:
--------------
trunk/blender/release/scripts/startup/bl_ui/properties_object.py
Modified: trunk/blender/release/scripts/startup/bl_ui/properties_object.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_object.py 2013-07-28 11:15:26 UTC (rev 58691)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_object.py 2013-07-28 11:43:11 UTC (rev 58692)
@@ -203,43 +203,56 @@
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')
+ # start top half
split = layout.split()
+
+ # left column checkboxes
col = split.column()
- col.prop(obj, "draw_type", text="Type")
+ col.prop(obj, "show_name", text="Name")
+ col.prop(obj, "show_axis", text="Axis")
+ if is_geometry:
+ # Makes no sense for cameras, armtures, etc.!
+ col.prop(obj, "show_wire", text="Wire")
+ if obj_type == 'MESH':
+ col.prop(obj, "show_all_edges")
+ # right column checkboxes
col = split.column()
- row = col.row()
- row.prop(obj, "show_bounds", text="Bounds")
- sub = row.row()
- sub.active = obj.show_bounds
+ 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 is_empty_image:
+ col.prop(obj, "show_transparent", text="Transparency")
+
+ # start bottom half
split = layout.split()
+ # left
col = split.column()
- col.prop(obj, "show_name", text="Name")
- col.prop(obj, "show_axis", text="Axis")
+ if obj_type not in {'CAMERA', 'EMPTY'}:
+ col.label(text="Maximum draw type:")
+ col.prop(obj, "draw_type", text="")
- obj_type = obj.type
-
- if obj_type in {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT'}:
- # Makes no sense for cameras, armtures, etc.!
- col.prop(obj, "show_wire", text="Wire")
+ # right
+ col = split.column()
+ if is_geometry or is_empty_image:
# Only useful with object having faces/materials...
- col.prop(obj, "color", text="Object Color")
+ col.label(text="Object Color:")
+ col.prop(obj, "color", text="")
- col = split.column()
- 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'):
- col.prop(obj, "show_transparent", text="Transparency")
- if obj_type == 'MESH':
- col.prop(obj, "show_all_edges")
-
class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
bl_label = "Duplication"
More information about the Bf-blender-cvs
mailing list