[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58700] trunk/blender/release/scripts/ startup/bl_ui/properties_object.py: UI / Code:
Thomas Dinges
blender at dingto.org
Mon Jul 29 00:12:19 CEST 2013
Revision: 58700
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58700
Author: dingto
Date: 2013-07-28 22:12:19 +0000 (Sun, 28 Jul 2013)
Log Message:
-----------
UI / Code:
Cody style changes for r58692.
* First of all, UI code is really simple, especially in such small panels, no need to comment obvious things like left/right column.
* "if 1" nested structs for code clarity? That's a really bad thing, especially if you have 3 lines which belong together, but only 2 of them are indented...
sub = row.row()
sub.active = obj.show_bounds
sub.prop(obj, "draw_bounds_type", text="")
* Empty line after layout = self.layout declarations, we still follow these Rules.
http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Layouts
Thanks!
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58692
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 19:53:46 UTC (rev 58699)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_object.py 2013-07-28 22:12:19 UTC (rev 58700)
@@ -203,31 +203,28 @@
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, "show_name", text="Name")
col.prop(obj, "show_axis", text="Axis")
if is_geometry:
- # Makes no sense for cameras, armtures, etc.!
+ # Makes no sense for cameras, armatures, etc.!
col.prop(obj, "show_wire", text="Wire")
if obj_type == 'MESH':
col.prop(obj, "show_all_edges")
- # right column checkboxes
col = split.column()
- if 1: # for code nesting clarity
- row = col.row()
- row.prop(obj, "show_bounds", text="Bounds")
- sub = row.row()
- sub.active = obj.show_bounds
+ 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:
@@ -236,16 +233,13 @@
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()
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...
More information about the Bf-blender-cvs
mailing list