2.5 Buttons Code:
authorThomas Dinges <blender@dingto.org>
Sun, 24 May 2009 12:37:55 +0000 (12:37 +0000)
committerThomas Dinges <blender@dingto.org>
Sun, 24 May 2009 12:37:55 +0000 (12:37 +0000)
* Code Cleanup.
* Tiny layout changes.
* Added proper context for bone, curve, mesh and text objects.

* Fixed Sun/Sky context.

14 files changed:
release/ui/buttons_data_armature.py
release/ui/buttons_data_bone.py
release/ui/buttons_data_camera.py
release/ui/buttons_data_curve.py
release/ui/buttons_data_empty.py
release/ui/buttons_data_lamp.py
release/ui/buttons_data_lattice.py
release/ui/buttons_data_mesh.py
release/ui/buttons_data_modifier.py
release/ui/buttons_data_text.py
release/ui/buttons_material.py
release/ui/buttons_objects.py
release/ui/buttons_scene.py
release/ui/buttons_world.py

index 2982ad52a6d0a8353ba67e59f7fb249a3cd12e4b..1d0043a5179df34c02a996b9a9a98bccb954aaf0 100644 (file)
@@ -1,3 +1,4 @@
+
 import bpy
  
 class DataButtonsPanel(bpy.types.Panel):
@@ -17,13 +18,11 @@ class DATA_PT_skeleton(DataButtonsPanel):
                arm = context.active_object.data
                layout = self.layout
                
-               row = layout.row()
-               row.itemR(arm, "rest_position")
+               layout.itemR(arm, "rest_position")
 
                split = layout.split()
 
                sub = split.column()
-
                sub.itemL(text="Deform:")
                sub.itemR(arm, "deform_vertexgroups", text="Vertes Groups")
                sub.itemR(arm, "deform_envelope", text="Envelopes")
@@ -38,7 +37,6 @@ class DATA_PT_skeleton(DataButtonsPanel):
                #sub.itemR(arm, "layer")
                #sub.itemR(arm, "layer_protection")
 
-
 class DATA_PT_display(DataButtonsPanel):
        __idname__ = "DATA_PT_display"
        __label__ = "Display"
@@ -59,7 +57,6 @@ class DATA_PT_display(DataButtonsPanel):
                sub.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
                sub.itemR(arm, "draw_group_colors", text="Colors")
 
-
 class DATA_PT_paths(DataButtonsPanel):
        __idname__ = "DATA_PT_paths"
        __label__ = "Paths"
@@ -71,11 +68,10 @@ class DATA_PT_paths(DataButtonsPanel):
                split = layout.split()
                
                sub = split.column()
-
                sub.itemR(arm, "paths_show_around_current_frame", text="Around Frame")
                if (arm.paths_show_around_current_frame):
-                               sub.itemR(arm, "path_before_current", text="Before")
-                               sub.itemR(arm, "path_after_current", text="After")
+                       sub.itemR(arm, "path_before_current", text="Before")
+                       sub.itemR(arm, "path_after_current", text="After")
                else:
                        sub.itemR(arm, "path_start_frame", text="Start")
                        sub.itemR(arm, "path_end_frame", text="End")
@@ -89,7 +85,6 @@ class DATA_PT_paths(DataButtonsPanel):
                sub.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
                sub.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers")
 
-               
 class DATA_PT_ghost(DataButtonsPanel):
        __idname__ = "DATA_PT_ghost"
        __label__ = "Ghost"
@@ -101,7 +96,6 @@ class DATA_PT_ghost(DataButtonsPanel):
                split = layout.split()
 
                sub = split.column()
-
                sub.itemR(arm, "ghost_type", text="Scope")
                if arm.ghost_type == 'RANGE':
                        sub.itemR(arm, "ghost_start_frame", text="Start")
@@ -112,10 +106,9 @@ class DATA_PT_ghost(DataButtonsPanel):
                        sub.itemR(arm, "ghost_size", text="Step")
 
                sub = split.column()
-
                sub.itemR(arm, "ghost_only_selected", text="Selected Only")
 
 bpy.types.register(DATA_PT_skeleton)
 bpy.types.register(DATA_PT_display)
 bpy.types.register(DATA_PT_paths)
-bpy.types.register(DATA_PT_ghost)
+bpy.types.register(DATA_PT_ghost)
\ No newline at end of file
index 6982b9beecbb5f02c031068c907b44795a89cc10..ea9fc3639f120ce82b21dda2bc04ea7c92dbb417 100644 (file)
@@ -15,7 +15,7 @@ class DATA_PT_bone(DataButtonsPanel):
        __label__ = "Bone"
 
        def draw(self, context):
-               bone = context.main.armatures[0].bones[0]
+               bone = context.active_object.data.bones[0]
                layout = self.layout
 
                split = layout.split()
@@ -26,7 +26,6 @@ class DATA_PT_bone(DataButtonsPanel):
                sub.itemR(bone, "connected")
                sub.itemR(bone, "deform")
 
-                               
                sub.itemL(text="Inherit:")
                sub.itemR(bone, "hinge")
                sub.itemR(bone, "inherit_scale")
@@ -48,20 +47,18 @@ class DATA_PT_bone(DataButtonsPanel):
                sub.itemR(bone, "bbone_in", text="Ease In")
                sub.itemR(bone, "bbone_out", text="Ease Out")
                
-               
                sub.itemR(bone, "cyclic_offset")
 
-
 class DATA_PT_constraints(DataButtonsPanel):
        __idname__ = "DATA_PT_constraints"
        __label__ = "Constraints"
        
        def draw(self, context):
-               bone = context.main.armatures[0].bones[0]
+               bone = context.active_object.data.bones[0]
                layout = self.layout
                split = layout.split()
                
                sub = split.column()
 
 bpy.types.register(DATA_PT_bone)
-bpy.types.register(DATA_PT_constraints)
+#bpy.types.register(DATA_PT_constraints)
\ No newline at end of file
index b41293758eaba6c787fc5be1e4219c541d0fd3f5..9770fdaf8ebf0a90bfef48423d66f26754efddd6 100644 (file)
@@ -18,19 +18,16 @@ class DATA_PT_cameralens(DataButtonsPanel):
                cam = context.active_object.data
                layout = self.layout
 
-               if not cam:
-                       return
-               
                layout.itemR(cam, "type", expand=True)
                
                row = layout.row(align=True)
                if cam.type == 'PERSP':
+                       row.itemR(cam, "lens_unit", text="")
                        if cam.lens_unit == 'MILLIMETERS':
                                row.itemR(cam, "lens", text="Angle")
                        elif cam.lens_unit == 'DEGREES':
                                row.itemR(cam, "angle")
 
-                       row.itemR(cam, "lens_unit", text="")
                elif cam.type == 'ORTHO':
                        row.itemR(cam, "ortho_scale")
                        
@@ -58,9 +55,6 @@ class DATA_PT_cameradisplay(DataButtonsPanel):
                cam = context.active_object.data
                layout = self.layout
 
-               if not cam:
-                       return
-                       
                split = layout.split()
                
                sub = split.column()
@@ -76,6 +70,4 @@ class DATA_PT_cameradisplay(DataButtonsPanel):
                sub.itemR(cam, "draw_size", text="Size")
                
 bpy.types.register(DATA_PT_cameralens)
-bpy.types.register(DATA_PT_cameradisplay)
-
-
+bpy.types.register(DATA_PT_cameradisplay)
\ No newline at end of file
index a51ce50b047eee5962337b0f18f3a20ed70f7868..12a1fefd47800299001e6338038b342d43c0186c 100644 (file)
@@ -9,20 +9,16 @@ class DataButtonsPanel(bpy.types.Panel):
        def poll(self, context):
                ob = context.active_object
                return (ob and ob.type == 'CURVE')
-       
 
 class DATA_PT_shape_curve(DataButtonsPanel):
                __idname__ = "DATA_PT_shape_curve"
                __label__ = "Shape"
 
                def draw(self, context):
-                       curve = context.main.curves[0]
+                       curve = context.active_object.data
                        layout = self.layout
 
-                       if not curve:
-                               return
-                       row = layout.row()
-                       row.itemR(curve, "curve_2d")                    
+                       layout.itemR(curve, "curve_2d")                 
                                                        
                        split = layout.split()
                
@@ -47,19 +43,14 @@ class DATA_PT_shape_curve(DataButtonsPanel):
                        sub.itemL(text="NORMALS")
                        sub.itemR(curve, "vertex_normal_flip")
 
-
 class DATA_PT_geometry(DataButtonsPanel):
                __idname__ = "DATA_PT_geometry"
                __label__ = "Geometry"
 
                def draw(self, context):
-                       curve = context.main.curves[0]
+                       curve = context.active_object.data
                        layout = self.layout
 
-                       if not curve:
-                               return
-                               
-                               
                        split = layout.split()
                
                        sub = split.column()
@@ -67,33 +58,25 @@ class DATA_PT_geometry(DataButtonsPanel):
                        sub.itemR(curve, "width")
                        sub.itemR(curve, "extrude")
                        sub.itemR(curve, "taper_object")
+                       
                        sub = split.column()
                        sub.itemL(text="Bevel:")
                        sub.itemR(curve, "bevel_depth", text="Depth")
                        sub.itemR(curve, "bevel_resolution", text="Resolution")
                        sub.itemR(curve, "bevel_object")
-
-
-
        
 class DATA_PT_pathanim(DataButtonsPanel):
                __idname__ = "DATA_PT_pathanim"
                __label__ = "Path Animation"
 
                def draw(self, context):
-                       curve = context.main.curves[0]
+                       curve = context.active_object.data
                        layout = self.layout
 
-                       if not curve:
-                               return
-                               
-                               
-                       split = layout.split()          
-                       sub = split.column(1)
-                       sub.itemR(curve, "path", text="Enable")
-
+                       layout.itemR(curve, "path", text="Enable")
                        
                        split = layout.split()          
+                       
                        sub = split.column()
                        sub.itemR(curve, "path_length", text="Frames")
                        sub.itemR(curve, "follow")
@@ -101,19 +84,15 @@ class DATA_PT_pathanim(DataButtonsPanel):
                        sub = split.column()
                        sub.itemR(curve, "stretch")
                        sub.itemR(curve, "offset_path_distance", text="Offset Children")
-
-                       
+       
 class DATA_PT_current_curve(DataButtonsPanel):
                __idname__ = "DATA_PT_current_curve"
                __label__ = "Current Curve"
 
                def draw(self, context):
-                       currentcurve = context.main.curves[0].curves[0]
+                       currentcurve = context.active_object.data.curves[0]
                        layout = self.layout
 
-                       if not currentcurve:
-                               return
-                               
                        split = layout.split()
                
                        sub = split.column()
@@ -129,6 +108,7 @@ class DATA_PT_current_curve(DataButtonsPanel):
                        sub.itemL(text="Endpoints:")
                        sub.itemR(currentcurve, "endpoint_u", text="U")
                        sub.itemR(currentcurve, "endpoint_v", text="V")
+                       
                        sub = split.column()
                        sub.itemL(text="Bezier:")
                        sub.itemR(currentcurve, "bezier_u", text="U")
@@ -144,4 +124,4 @@ class DATA_PT_current_curve(DataButtonsPanel):
 bpy.types.register(DATA_PT_shape_curve)
 bpy.types.register(DATA_PT_geometry)
 bpy.types.register(DATA_PT_pathanim)
-bpy.types.register(DATA_PT_current_curve)
+bpy.types.register(DATA_PT_current_curve)
\ No newline at end of file
index 5fe1e943f1f790714a66f5d980b4ae5e218c721e..94caa4ed700551f5c800e1456447e3c4d6edab88 100644 (file)
@@ -18,10 +18,7 @@ class DATA_PT_empty(DataButtonsPanel):
                ob = context.active_object
                layout = self.layout
 
-               if not ob:
-                       return
-                       
                layout.itemR(ob, "empty_draw_type")
                layout.itemR(ob, "empty_draw_size")
                
-bpy.types.register(DATA_PT_empty)
+bpy.types.register(DATA_PT_empty)
\ No newline at end of file
index e23215da9316131ee9108da8dfe05dbca06a7c4e..157a89eb2c710246837f7ee2d3e5b5e0e2804b8e 100644 (file)
@@ -18,11 +18,7 @@ class DATA_PT_lamp(DataButtonsPanel):
                lamp = context.active_object.data
                layout = self.layout
 
-               if not lamp:
-                       return
-               
-               row = layout.row()
-               row.itemR(lamp, "type", expand=True)
+               layout.itemR(lamp, "type", expand=True)
                
                split = layout.split()
                
@@ -64,12 +60,9 @@ class DATA_PT_sunsky(DataButtonsPanel):
                return (ob.type == 'LAMP' and ob.data.type == 'SUN')
 
        def draw(self, context):
-               lamp = context.active_object.data
+               lamp = context.active_object.data.sky
                layout = self.layout
 
-               if not lamp:
-                       return
-               
                row = layout.row()
                row.itemR(lamp, "sky")
                row.itemR(lamp, "atmosphere")
@@ -86,6 +79,7 @@ class DATA_PT_sunsky(DataButtonsPanel):
                                sub.itemR(lamp, "sky_blend")
                                sub.itemR(lamp, "sky_color_space", text="Color Space")
                                sub.itemR(lamp, "sky_exposure")
+                               
                                sub = col.column()
                                sub.itemR(lamp, "horizon_brightness", text="Hor Bright")
                                sub.itemR(lamp, "spread", text="Hor Spread")
@@ -112,9 +106,6 @@ class DATA_PT_shadow(DataButtonsPanel):
                lamp = context.active_object.data
                layout = self.layout
 
-               if not lamp:
-                       return
-               
                layout.itemR(lamp, "shadow_method", expand=True)
                
                if lamp.shadow_method in ('BUFFER_SHADOW', 'RAY_SHADOW'):
@@ -194,9 +185,6 @@ class DATA_PT_spot(DataButtonsPanel):
                lamp = context.active_object.data
                layout = self.layout
 
-               if not lamp:
-                       return
-               
                split = layout.split()
                
                sub = split.column()
@@ -214,4 +202,4 @@ class DATA_PT_spot(DataButtonsPanel):
 bpy.types.register(DATA_PT_lamp)
 bpy.types.register(DATA_PT_shadow)
 bpy.types.register(DATA_PT_sunsky)
-bpy.types.register(DATA_PT_spot)
+bpy.types.register(DATA_PT_spot)
\ No newline at end of file
index c7d5b9cfe4a255bd294f050a828a0cb4ba966231..4bcff9f53892f75f0c4ba1d47dc93ae8b9f66a00 100644 (file)
@@ -18,9 +18,6 @@ class DATA_PT_lattice(DataButtonsPanel):
                lat = context.active_object.data
                layout = self.layout
 
-               if not lat:
-                       return
-               
                row = layout.row()
                row.itemR(lat, "points_u")
                row.itemR(lat, "interpolation_type_u", expand=True)
@@ -37,4 +34,4 @@ class DATA_PT_lattice(DataButtonsPanel):
                row.itemR(lat, "outside")
                row.itemR(lat, "shape_keys")
 
-bpy.types.register(DATA_PT_lattice)
+bpy.types.register(DATA_PT_lattice)
\ No newline at end of file
index e52bc8cb9570a222d41ceef9043413c42c224c2e..44a48dcc534b4e9399e0c92e1e5ec7035cd24644 100644 (file)
@@ -9,18 +9,15 @@ class DataButtonsPanel(bpy.types.Panel):
        def poll(self, context):
                ob = context.active_object
                return (ob and ob.type == 'MESH')
-       
 
 class DATA_PT_surface(DataButtonsPanel):
                __idname__ = "DATA_PT_surface"
                __label__ = "Surface"
 
                def draw(self, context):
-                       mesh = context.main.meshes[0]
+                       mesh = context.active_object.data
                        layout = self.layout
 
-                       if not mesh:
-                               return
                        split = layout.split()
                
                        sub = split.column()
@@ -29,7 +26,7 @@ class DATA_PT_surface(DataButtonsPanel):
                        sub = split.column()
                        sub.itemR(mesh, "vertex_normal_flip")
                        sub.itemR(mesh, "double_sided")
-                       row = layout.row()
-                       row.itemR(mesh, "texco_mesh")                   
+                       
+                       layout.itemR(mesh, "texco_mesh")                        
                                                
 bpy.types.register(DATA_PT_surface)            
\ No newline at end of file
index 7167727ea530c1c7520532357e3c33c0f3abfae1..d60df5df528f3718af1b267f10c2f9e4f2961a15 100644 (file)
@@ -18,9 +18,6 @@ class DATA_PT_modifiers(DataButtonsPanel):
                ob = context.active_object
                layout = self.layout
 
-               if not ob:
-                       return
-
                row = layout.row()
                row.item_menu_enumO("OBJECT_OT_modifier_add", "type")
                row.itemL();
@@ -383,5 +380,4 @@ class DATA_PT_modifiers(DataButtonsPanel):
                col.itemR(md, "width", slider=True)
                col.itemR(md, "narrowness", slider=True)
 
-bpy.types.register(DATA_PT_modifiers)
-
+bpy.types.register(DATA_PT_modifiers)
\ No newline at end of file
index 8db1d0316a9ed49f16df9819b2ed2708ecf80124..96147270209dd9bfc56d4428f687e53e95860165 100644 (file)
@@ -15,13 +15,10 @@ class DATA_PT_shape_text(DataButtonsPanel):
                __label__ = "Shape"
 
                def draw(self, context):
-                       curve = context.main.curves[0]
+                       curve = context.active_object.data
                        layout = self.layout
 
-                       if not curve:
-                               return
-                       row = layout.row()
-                       row.itemR(curve, "curve_2d")                    
+                       layout.itemR(curve, "curve_2d")                 
                                                        
                        split = layout.split()
                
@@ -44,34 +41,29 @@ class DATA_PT_shape_text(DataButtonsPanel):
                        sub.itemL(text="Display:")
                        sub.itemR(curve, "fast")
                        
-
 class DATA_PT_font(DataButtonsPanel):
        __idname__ = "DATA_PT_font"
        __label__ = "Font"
 
        def draw(self, context):
-               text = context.main.curves[0]
+               text = context.active_object.data
                layout = self.layout
 
-               if not text:
-                       return
-               
                layout.row()
                layout.itemR(text, "font")
                
                split = layout.split()
                
                sub = split.column()    
-
        #       sub.itemR(text, "style")
-               sub.itemR(text, "bold")
-               sub.itemR(text, "italic")
-               sub.itemR(text, "underline")
+       #       sub.itemR(text, "bold")
+       #       sub.itemR(text, "italic")
+       #       sub.itemR(text, "underline")
+       #       ToDo: These settings are in a sub struct (Edit Format). 
                sub.itemR(text, "text_size")            
                sub.itemR(text, "shear")
 
                sub = split.column()
-
                sub.itemR(text, "text_on_curve")
                sub.itemR(text, "family")
                sub.itemL(text="Underline:")
@@ -80,30 +72,20 @@ class DATA_PT_font(DataButtonsPanel):
 
        #       sub.itemR(text, "edit_format")
 
-
-
-
-               
 class DATA_PT_paragraph(DataButtonsPanel):
        __idname__ = "DATA_PT_paragraph"
        __label__ = "Paragraph"
 
        def draw(self, context):
-               text = context.main.curves[0]
+               text = context.active_object.data
                layout = self.layout
 
-               if not text:
-                       return
-                       
-               row = layout.row()
-               row.itemL(text="Align:")
-               row = layout.row()
-               row.itemR(text, "spacemode", expand=True)
+               layout.itemL(text="Align:")
+               layout.itemR(text, "spacemode", expand=True)
 
                split = layout.split()
                
                sub = split.column()    
-
                sub.itemL(text="Spacing:")
                sub.itemR(text, "spacing", text="Character")
                sub.itemR(text, "word_spacing", text="Word")
@@ -120,16 +102,10 @@ class DATA_PT_textboxes(DataButtonsPanel):
                __label__ = "Text Boxes"
 
                def draw(self, context):
-                       text = context.main.curves[0]
+                       text = context.active_object.data
                        layout = self.layout
 
-                       if not text:
-                               return
-                               
-
-                       
 bpy.types.register(DATA_PT_shape_text) 
 bpy.types.register(DATA_PT_font)
 bpy.types.register(DATA_PT_paragraph)
-bpy.types.register(DATA_PT_textboxes)
-
+#bpy.types.register(DATA_PT_textboxes)
\ No newline at end of file
index 63e1624d6db58f1593ccb5d2035dbac6954fd16f..a468a55efbaffa19c1303c2e01df5e865a5df0a0 100644 (file)
@@ -18,16 +18,14 @@ class MATERIAL_PT_material(MaterialButtonsPanel):
                layout = self.layout
                mat = context.active_object.active_material
        
-               row = layout.row()
-               row.itemR(mat, "type", expand=True)
+               layout.itemR(mat, "type", expand=True)
 
                row = layout.row()
                row.column().itemR(mat, "diffuse_color")
                row.column().itemR(mat, "specular_color")
                row.column().itemR(mat, "mirror_color")
                
-               row = layout.row()
-               row.itemR(mat, "alpha", slider=True)
+               layout.itemR(mat, "alpha", slider=True)
                        
 class MATERIAL_PT_sss(MaterialButtonsPanel):
        __idname__= "MATERIAL_PT_sss"
@@ -93,10 +91,11 @@ class MATERIAL_PT_raymir(MaterialButtonsPanel):
                sub.itemR(raym, "gloss_samples")
                sub.itemR(raym, "gloss_anisotropic", slider=True)
                
-               flow = layout.column_flow()
-               flow.itemR(raym, "distance", text="Max Dist")
-               flow.itemR(raym, "depth")
-               flow.itemR(raym, "fade_to")
+               row = layout.row()
+               row.itemR(raym, "distance", text="Max Dist")
+               row.itemR(raym, "depth")
+               
+               layout.itemR(raym, "fade_to")
                
 class MATERIAL_PT_raytransp(MaterialButtonsPanel):
        __idname__= "MATERIAL_PT_raytransp"
@@ -193,4 +192,4 @@ bpy.types.register(MATERIAL_PT_material)
 bpy.types.register(MATERIAL_PT_raymir)
 bpy.types.register(MATERIAL_PT_raytransp)
 bpy.types.register(MATERIAL_PT_sss)
-bpy.types.register(MATERIAL_PT_halo)
+bpy.types.register(MATERIAL_PT_halo)
\ No newline at end of file
index c0e1f439df81ba14db25d3e495bb57b840448eaa..8f02a015eac439a65f07dbea52de5a19daf87a35 100644 (file)
@@ -77,10 +77,9 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
                ob = context.active_object
                layout = self.layout
 
-               row = layout.row()
-               row.itemR(ob, "dupli_type", expand=True)
+               layout.itemR(ob, "dupli_type", expand=True)
 
-               if ob.dupli_type == "FRAMES":
+               if ob.dupli_type == 'FRAMES':
                        split = layout.split()
                        
                        sub = split.column(align=True)
@@ -91,29 +90,18 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
                        sub.itemR(ob, "dupli_frames_on", text="On")
                        sub.itemR(ob, "dupli_frames_off", text="Off")
                        
-                       split = layout.split()
-                       sub = split.column()
-                       sub.itemR(ob, "dupli_frames_no_speed", text="No Speed")
+                       layout.itemR(ob, "dupli_frames_no_speed", text="No Speed")
 
-               elif ob.dupli_type == "VERTS":
-                       split = layout.split()
-                       
-                       sub = split.column(align=True)
-                       sub.itemR(ob, "dupli_verts_rotation", text="Rotation")
+               elif ob.dupli_type == 'VERTS':
+                       layout.itemR(ob, "dupli_verts_rotation", text="Rotation")
 
-               elif ob.dupli_type == "FACES":
-                       split = layout.split()
-                       
-                       sub = split.column()
-                       sub.itemR(ob, "dupli_faces_scale", text="Scale")
-                       sub = split.column()
-                       sub.itemR(ob, "dupli_faces_inherit_scale", text="Inherit Scale")
+               elif ob.dupli_type == 'FACES':
+                       row = layout.row()
+                       row.itemR(ob, "dupli_faces_scale", text="Scale")
+                       row.itemR(ob, "dupli_faces_inherit_scale", text="Inherit Scale")
 
-               elif ob.dupli_type == "GROUP":
-                       split = layout.split()
-                       
-                       sub = split.column(align=True)
-                       sub.itemR(ob, "dupli_group", text="Group")
+               elif ob.dupli_type == 'GROUP':
+                       layout.itemR(ob, "dupli_group", text="Group")
 
 class OBJECT_PT_animation(ObjectButtonsPanel):
        __idname__ = "OBJECT_PT_animation"
@@ -122,10 +110,10 @@ class OBJECT_PT_animation(ObjectButtonsPanel):
        def draw(self, context):
                ob = context.active_object
                layout = self.layout
-
-               row = layout.row()
                
-               sub = row.column()
+               split = layout.split()
+               
+               sub = split.column()
                sub.itemL(text="Time Offset:")
                sub.itemR(ob, "time_offset_edit", text="Edit")
                sub.itemR(ob, "time_offset_particle", text="Particle")
@@ -133,7 +121,7 @@ class OBJECT_PT_animation(ObjectButtonsPanel):
                sub.itemR(ob, "slow_parent")
                sub.itemR(ob, "time_offset", text="Offset")
                
-               sub = row.column()
+               sub = split.column()
                sub.itemL(text="Tracking:")
                sub.itemR(ob, "track_axis", text="Axis")
                sub.itemR(ob, "up_axis", text="Up Axis")
@@ -143,5 +131,4 @@ bpy.types.register(OBJECT_PT_transform)
 bpy.types.register(OBJECT_PT_groups)
 bpy.types.register(OBJECT_PT_display)
 bpy.types.register(OBJECT_PT_duplication)
-bpy.types.register(OBJECT_PT_animation)
-
+bpy.types.register(OBJECT_PT_animation)
\ No newline at end of file
index 9682eabbccf441afd91daf9ca5837f826efdc0e4..a9f25fd625dcd54f551f6e1115131c92ddfd2f95 100644 (file)
@@ -37,8 +37,7 @@ class RENDER_PT_output(RenderButtonsPanel):
 
                rd = scene.render_data
                
-               col = layout.column()
-               col.itemR(rd, "output_path")
+               layout.itemR(rd, "output_path")
                
                split = layout.split()
                
@@ -65,8 +64,7 @@ class RENDER_PT_output(RenderButtonsPanel):
                if rd.fields:
                        sub.itemR(rd, "fields_still", text="Still")
                        sub.row().itemR(rd, "field_order", expand=True)
-               
-       
+
 class RENDER_PT_antialiasing(RenderButtonsPanel):
        __label__ = "Anti-Aliasing"
 
@@ -174,4 +172,4 @@ bpy.types.register(RENDER_PT_render)
 bpy.types.register(RENDER_PT_dimensions)
 bpy.types.register(RENDER_PT_antialiasing)
 bpy.types.register(RENDER_PT_shading)
-bpy.types.register(RENDER_PT_output)
+bpy.types.register(RENDER_PT_output)
\ No newline at end of file
index 0bcd466366a3efa3538c104bb4a42a7756a18364..401fbcb0c2220cc7a9bd010750331beac52a9304 100644 (file)
@@ -93,16 +93,14 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
 
                ao = world.ambient_occlusion
                
-               row = layout.row()
-               row.itemR(ao, "gather_method", expand=True)
+               layout.itemR(ao, "gather_method", expand=True)
                
                if ao.gather_method == 'RAYTRACE':
                        row = layout.row()
                        row.itemR(ao, "samples")
                        row.itemR(ao, "distance")
                        
-                       row = layout.row()
-                       row.itemR(ao, "sample_method")
+                       layout.itemR(ao, "sample_method")
                        if ao.sample_method == 'ADAPTIVE_QMC':
                                row = layout.row()
                                row.itemR(ao, "threshold")
@@ -113,17 +111,12 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
                                row.itemR(ao, "bias")
                                                
                if ao.gather_method == 'APPROXIMATE':
-                       row = layout.row()
-                       row.itemR(ao, "passes")
-                       row.itemR(ao, "error_tolerance", text="Error")
-                       
-                       row = layout.row()
-                       row.itemR(ao, "correction")
-                       row.itemR(ao, "pixel_cache")
+                       col = layout.column_flow()
+                       col.itemR(ao, "passes")
+                       col.itemR(ao, "error_tolerance", text="Error")
+                       col.itemR(ao, "correction")
+                       col.itemR(ao, "pixel_cache")
 
-               row = layout.row()
-               row.itemS()
-                       
                row = layout.row()
                row.itemR(ao, "falloff")        
                row.itemR(ao, "strength")
@@ -137,5 +130,4 @@ bpy.types.register(WORLD_PT_world)
 bpy.types.register(WORLD_PT_ambient_occlusion)
 bpy.types.register(WORLD_PT_mist)
 bpy.types.register(WORLD_PT_stars)
-bpy.types.register(WORLD_PT_color_correction)
-
+bpy.types.register(WORLD_PT_color_correction)
\ No newline at end of file