2.5 Part 3 of Layout Code Cleanup:
authorThomas Dinges <blender@dingto.org>
Thu, 30 Jul 2009 10:11:19 +0000 (10:11 +0000)
committerThomas Dinges <blender@dingto.org>
Thu, 30 Jul 2009 10:11:19 +0000 (10:11 +0000)
* More cleanup to match new coding guidelines.
http://wiki.blender.org/index.php/Dev:Py/Blender2.5/Layouts/Guidelines

* Replaced some if's with proper elif's.
* Removed some unnecessary code.
Note: Please don't use inconsistent assign names like colsub, subcol1 etc. anymore!

release/ui/buttons_data_lamp.py
release/ui/buttons_data_metaball.py
release/ui/buttons_game.py
release/ui/buttons_material.py
release/ui/buttons_object.py
release/ui/buttons_object_constraint.py
release/ui/buttons_physics_field.py
release/ui/buttons_physics_fluid.py
release/ui/buttons_physics_softbody.py
release/ui/buttons_scene.py

index 5be25278e93d225ff7b01faf8fba15117ef3cfef..a522a66c87134f1aa725fda971b02f6e86692945 100644 (file)
@@ -52,41 +52,24 @@ class DATA_PT_lamp(DataButtonsPanel):
                sub = col.column()
                sub.itemR(lamp, "color", text="")
                sub.itemR(lamp, "energy")
-               
-       
-               
-               
-               #split = layout.split()
-               
+
                if lamp.type in ('POINT', 'SPOT'):
-                       #col = split.column()
-                       #col.itemL(text="Falloff:")
-                       sub = col.column()
                        sub.itemR(lamp, "falloff_type", text="Falloff")
                        sub.itemR(lamp, "distance")
-                       
-                       
+
                        if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED':
-                               #col = split.column()
                                col.itemL(text="Attenuation Factors:")
                                sub = col.column(align=True)
                                sub.itemR(lamp, "linear_attenuation", slider=True, text="Linear")
                                sub.itemR(lamp, "quadratic_attenuation", slider=True, text="Quadratic")
-                       #else:
-                               # 
-                               # split.column()
                        
                        col.itemR(lamp, "sphere")
                        
                if lamp.type == 'AREA':
-                       #col = split.column()
                        col.itemR(lamp, "distance")
                        col.itemR(lamp, "gamma")
-
-                       #col = split.column()
-                       
-                       
                        col.itemR(lamp, "shape")
+                       
                        sub = col.column(align=True)
                        if (lamp.shape == 'SQUARE'):
                                sub.itemR(lamp, "size")
@@ -99,7 +82,6 @@ class DATA_PT_lamp(DataButtonsPanel):
                col.itemR(lamp, "layer", text="This Layer Only")
                col.itemR(lamp, "specular")
                col.itemR(lamp, "diffuse")      
-                       
 
 class DATA_PT_sunsky(DataButtonsPanel):
        __label__ = "Sun/Sky"
index 009a13df0b74a90eb7e45a45305ee91e0c40da2b..fa463d49c0d6917dec847563bed7b2d9de40f414 100644 (file)
@@ -76,8 +76,7 @@ class DATA_PT_metaball_element(DataButtonsPanel):
                col.itemR(metaelem, "stiffness", text="Stiffness")
                col.itemR(metaelem, "negative", text="Negative")
                col.itemR(metaelem, "hide", text="Hide")
-               
-       
+
 bpy.types.register(DATA_PT_context_metaball)
 bpy.types.register(DATA_PT_metaball)
 bpy.types.register(DATA_PT_metaball_element)
\ No newline at end of file
index 3f60bceb284e104eb24ba86a8ccc102581a736bc..9635ecfa67c370d30d882f9fa4190907746a3f78 100644 (file)
@@ -16,70 +16,78 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
-               ob = context.active_object
                
+               ob = context.active_object
                game = ob.game
 
                layout.itemR(game, "physics_type")
                layout.itemS()
                
                split = layout.split()
-               col = split.column()
                
+               col = split.column()
                col.itemR(game, "actor")
-               
                col.itemR(game, "ghost")
                col.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
+               
                col = split.column()
                col.itemR(game, "do_fh", text="Use Material Physics")
                col.itemR(game, "rotation_fh", text="Rotate From Normal")
                col.itemR(game, "no_sleeping")
                
                layout.itemS()
+               
                split = layout.split()
+               
                col = split.column()
                col.itemL(text="Attributes:")
-               colsub = col.column(align=True)
-               colsub.itemR(game, "mass")
-               colsub.itemR(game, "radius")
-               colsub.itemR(game, "form_factor")
+               sub = col.column(align=True)
+               sub.itemR(game, "mass")
+               sub.itemR(game, "radius")
+               sub.itemR(game, "form_factor")
+               
                col.itemS()
+               
                col.itemL(text="Damping:")
-               colsub = col.column(align=True)
-               colsub.itemR(game, "damping", text="Translation", slider=True)
-               colsub.itemR(game, "rotation_damping", text="Rotation", slider=True)
+               sub = col.column(align=True)
+               sub.itemR(game, "damping", text="Translation", slider=True)
+               sub.itemR(game, "rotation_damping", text="Rotation", slider=True)
                
                col = split.column()
-               
                col.itemL(text="Velocity:")
-               colsub = col.column(align=True)
-               colsub.itemR(game, "minimum_velocity", text="Minimum")
-               colsub.itemR(game, "maximum_velocity", text="Maximum")
+               sub = col.column(align=True)
+               sub.itemR(game, "minimum_velocity", text="Minimum")
+               sub.itemR(game, "maximum_velocity", text="Maximum")
+               
                col.itemS()
-               col.itemR(game, "anisotropic_friction")
                
-               colsub = col.column()
-               colsub.active = game.anisotropic_friction
-               colsub.itemR(game, "friction_coefficients", text="", slider=True)
+               col.itemR(game, "anisotropic_friction")
+               sub = col.column()
+               sub.active = game.anisotropic_friction
+               sub.itemR(game, "friction_coefficients", text="", slider=True)
                
                layout.itemS()
+               
                split = layout.split()
-               sub = split.column()
-               sub.itemL(text="Lock Translation:")
-               sub.itemR(game, "lock_x_axis", text="X")
-               sub.itemR(game, "lock_y_axis", text="Y")
-               sub.itemR(game, "lock_z_axis", text="Z")
-               sub = split.column()
-               sub.itemL(text="Lock Rotation:")
-               sub.itemR(game, "lock_x_rot_axis", text="X")
-               sub.itemR(game, "lock_y_rot_axis", text="Y")
-               sub.itemR(game, "lock_z_rot_axis", text="Z")
+               
+               col = split.column()
+               col.itemL(text="Lock Translation:")
+               col.itemR(game, "lock_x_axis", text="X")
+               col.itemR(game, "lock_y_axis", text="Y")
+               col.itemR(game, "lock_z_axis", text="Z")
+               
+               col = split.column()
+               col.itemL(text="Lock Rotation:")
+               col.itemR(game, "lock_x_rot_axis", text="X")
+               col.itemR(game, "lock_y_rot_axis", text="Y")
+               col.itemR(game, "lock_z_rot_axis", text="Z")
 
 class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
        __label__ = "Collision Bounds"
 
        def draw_header(self, context):
                layout = self.layout
+               
                ob = context.active_object
                game = ob.game
 
@@ -90,17 +98,13 @@ class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
                
                ob = context.scene.objects[0]
                game = ob.game
-               layout.active = game.use_collision_bounds
-               
-               
                
+               layout.active = game.use_collision_bounds
                layout.itemR(game, "collision_bounds", text="Bounds")
                
-               split = layout.split()
-               sub = split.column()
-               sub.itemR(game, "collision_compound", text="Compound")
-               sub = split.column()
-               sub.itemR(game, "collision_margin", text="Margin", slider=True)
+               row = layout.row()
+               row.itemR(game, "collision_compound", text="Compound")
+               row.itemR(game, "collision_margin", text="Margin", slider=True)
 
 bpy.types.register(PHYSICS_PT_game_physics)
 bpy.types.register(PHYSICS_PT_game_collision_bounds)
@@ -119,6 +123,7 @@ class SCENE_PT_game(SceneButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                rd = context.scene.render_data
 
                row = layout.row()
@@ -130,64 +135,63 @@ class SCENE_PT_game_player(SceneButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                gs = context.scene.game_data
-               row = layout.row()
-               row.itemR(gs, "fullscreen")
+               
+               layout.itemR(gs, "fullscreen")
 
                split = layout.split()
+               
                col = split.column()
                col.itemL(text="Resolution:")
-               colsub = col.column(align=True)
-               colsub.itemR(gs, "resolution_x", slider=False, text="X")
-               colsub.itemR(gs, "resolution_y", slider=False, text="Y")
+               sub = col.column(align=True)
+               sub.itemR(gs, "resolution_x", slider=False, text="X")
+               sub.itemR(gs, "resolution_y", slider=False, text="Y")
 
                col = split.column()
                col.itemL(text="Quality:")
-               colsub = col.column(align=True)
-               colsub.itemR(gs, "depth", text="Bit Depth", slider=False)
-               colsub.itemR(gs, "frequency", text="FPS", slider=False)
+               sub = col.column(align=True)
+               sub.itemR(gs, "depth", text="Bit Depth", slider=False)
+               sub.itemR(gs, "frequency", text="FPS", slider=False)
 
                # framing:
                col = layout.column()
                col.itemL(text="Framing:")
                col.row().itemR(gs, "framing_type", expand=True)
-
-               colsub = col.column()
-               colsub.itemR(gs, "framing_color", text="")
+               sub = col.column()
+               sub.itemR(gs, "framing_color", text="")
 
 class SCENE_PT_game_stereo(SceneButtonsPanel):
        __label__ = "Stereo"
 
        def draw(self, context):
                layout = self.layout
+               
                gs = context.scene.game_data
+               stereo_mode = gs.stereo
 
                # stereo options:
-               col= layout.column()
-               row = col.row()
-               row.itemR(gs, "stereo", expand=True)
+               layout.itemR(gs, "stereo", expand=True)
  
-               stereo_mode = gs.stereo
-
                # stereo:
                if stereo_mode == 'STEREO':
-                       row = layout.row()
-                       row.itemR(gs, "stereo_mode")
+                       layout.itemR(gs, "stereo_mode")
 
                # dome:
                if stereo_mode == 'DOME':
-                       row = layout.row()
-                       row.itemR(gs, "dome_mode", text="Dome Type")
+                       layout.itemR(gs, "dome_mode", text="Dome Type")
 
                        split=layout.split()
+                       
                        col=split.column()
                        col.itemR(gs, "dome_angle", slider=True)
                        col.itemR(gs, "dome_tesselation", text="Tesselation")
+                       
                        col=split.column()
                        col.itemR(gs, "dome_tilt")
                        col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
-                       col=layout.column()
-                       col.itemR(gs, "dome_text")
+                       
+                       layout.itemR(gs, "dome_text")
 
 bpy.types.register(SCENE_PT_game)
 bpy.types.register(SCENE_PT_game_player)
@@ -207,7 +211,7 @@ class WORLD_PT_game_context_world(WorldButtonsPanel):
 
        def poll(self, context):
                rd = context.scene.render_data
-               return (context.scene != None) and (rd.use_game_engine)
+               return (context.scene) and (rd.use_game_engine)
 
        def draw(self, context):
                layout = self.layout
@@ -228,6 +232,7 @@ class WORLD_PT_game_world(WorldButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                world = context.world
 
                row = layout.row()
@@ -270,35 +275,39 @@ class WORLD_PT_game_physics(WorldButtonsPanel):
  
        def draw(self, context):
                layout = self.layout
+               
                gs = context.scene.game_data
-               flow = layout.column_flow()
-               flow.itemR(gs, "physics_engine")
+               
+               layout.itemR(gs, "physics_engine")
                if gs.physics_engine != "NONE":
-                       flow.itemR(gs, "physics_gravity", text="Gravity")
+                       layout.itemR(gs, "physics_gravity", text="Gravity")
  
                        split = layout.split()
+                       
                        col = split.column()
                        col.itemL(text="Physics Steps:")
-                       colsub = col.column(align=True)
-                       colsub.itemR(gs, "physics_step_max", text="Max")
-                       colsub.itemR(gs, "physics_step_sub", text="Substeps")
+                       sub = col.column(align=True)
+                       sub.itemR(gs, "physics_step_max", text="Max")
+                       sub.itemR(gs, "physics_step_sub", text="Substeps")
                        col.itemR(gs, "fps", text="FPS")
                        
                        col = split.column()
                        col.itemL(text="Logic Steps:")
                        col.itemR(gs, "logic_step_max", text="Max")
-                       col.itemS()
-                       col.itemR(gs, "use_occlusion_culling", text="Occlusion Culling")
-                       colsub = col.column()
-                       colsub.active = gs.use_occlusion_culling
-                       colsub.itemR(gs, "occlusion_culling_resolution", text="Resolution")
                        
+                       col = layout.column()
+                       col.itemR(gs, "use_occlusion_culling", text="Occlusion Culling")
+                       sub = col.column()
+                       sub.active = gs.use_occlusion_culling
+                       sub.itemR(gs, "occlusion_culling_resolution", text="Resolution")
 
                else:
                        split = layout.split()
+                       
                        col = split.column()
                        col.itemL(text="Physics Steps:")
                        col.itemR(gs, "fps", text="FPS")
+                       
                        col = split.column()
                        col.itemL(text="Logic Steps:")
                        col.itemR(gs, "logic_step_max", text="Max")
@@ -306,4 +315,3 @@ class WORLD_PT_game_physics(WorldButtonsPanel):
 bpy.types.register(WORLD_PT_game_context_world)
 bpy.types.register(WORLD_PT_game_world)
 bpy.types.register(WORLD_PT_game_physics)
-
index 26a5294f218a0b2412e1563bde216d06c17d3238..729d39e3b60847caa2fb978e7623f13d720239df 100644 (file)
@@ -11,18 +11,17 @@ class MaterialButtonsPanel(bpy.types.Panel):
                return (context.material) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
 
 class MATERIAL_PT_preview(MaterialButtonsPanel):
-       __idname__= "MATERIAL_PT_preview"
        __label__ = "Preview"
        COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
 
        def draw(self, context):
                layout = self.layout
+               
                mat = context.material
                
                layout.template_preview(mat)
                
 class MATERIAL_PT_context_material(MaterialButtonsPanel):
-       __idname__= "MATERIAL_PT_context_material"
        __show_header__ = False
        COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
 
@@ -51,7 +50,6 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
 
                        if context.edit_object:
                                row = layout.row(align=True)
-
                                row.itemO("object.material_slot_assign", text="Assign")
                                row.itemO("object.material_slot_select", text="Select")
                                row.itemO("object.material_slot_deselect", text="Deselect")
@@ -88,117 +86,115 @@ class MATERIAL_PT_material(MaterialButtonsPanel):
                        if mat.type in ('SURFACE', 'WIRE', 'VOLUME'):
                                split = layout.split()
        
-                               sub = split.column()
-                               sub.itemR(mat, "alpha", slider=True)
-                               sub.itemR(mat, "ambient", slider=True)
-                               sub.itemR(mat, "emit")
-                               sub.itemR(mat, "translucency", slider=True)
+                               col = split.column()
+                               col.itemR(mat, "alpha", slider=True)
+                               col.itemR(mat, "ambient", slider=True)
+                               col.itemR(mat, "emit")
+                               col.itemR(mat, "translucency", slider=True)
                                
-                               sub = split.column()
-                               sub.itemR(mat, "z_transparency")
-                               sub.itemR(mat, "shadeless")     
-                               sub.itemR(mat, "tangent_shading")
-                               sub.itemR(mat, "cubic", slider=True)
+                               col = split.column()
+                               col.itemR(mat, "z_transparency")
+                               col.itemR(mat, "shadeless")     
+                               col.itemR(mat, "tangent_shading")
+                               col.itemR(mat, "cubic", slider=True)
                                
                        elif mat.type == 'HALO':
                                layout.itemR(mat, "alpha", slider=True)
                        
 class MATERIAL_PT_strand(MaterialButtonsPanel):
-       __idname__= "MATERIAL_PT_strand"
        __label__ = "Strand"
        __default_closed__ = True
        COMPAT_ENGINES = set(['BLENDER_RENDER'])
        
        def draw(self, context):
                layout = self.layout
-               tan = context.material.strand
+               
                mat = context.material
+               tan = mat.strand
                
                split = layout.split()
                
-               sub = split.column()
-               sub.itemL(text="Size:")
-               sub.itemR(tan, "start_size", text="Root")
-               sub.itemR(tan, "end_size", text="Tip")
-               sub.itemR(tan, "min_size", text="Minimum")
-               sub.itemR(tan, "blender_units")
-               colsub = sub.column()
-               colsub.active = mat.shadeless== False
-               colsub.itemR(tan, "tangent_shading")
-               
-               sub = split.column()
-               sub.itemR(tan, "shape")
-               sub.itemR(tan, "width_fade")
-               sub.itemR(tan, "uv_layer")
-               colsub = sub.column()
-               colsub.active = mat.shadeless== False
-               colsub.itemR(tan, "surface_diffuse")
-               colsubsub = colsub.column()
-               colsubsub.active = tan.surface_diffuse
-               colsubsub.itemR(tan, "blend_distance", text="Distance")
+               col = split.column()
+               col.itemL(text="Size:")
+               col.itemR(tan, "start_size", text="Root")
+               col.itemR(tan, "end_size", text="Tip")
+               col.itemR(tan, "min_size", text="Minimum")
+               col.itemR(tan, "blender_units")
+               sub = col.column()
+               sub.active = mat.shadeless == False
+               sub.itemR(tan, "tangent_shading")
+               
+               col = split.column()
+               col.itemR(tan, "shape")
+               col.itemR(tan, "width_fade")
+               col.itemR(tan, "uv_layer")
+               sub = col.column()
+               sub.active = mat.shadeless == False
+               sub.itemR(tan, "surface_diffuse")
+               sub = col.column()
+               sub.active = tan.surface_diffuse
+               sub.itemR(tan, "blend_distance", text="Distance")
                
 class MATERIAL_PT_options(MaterialButtonsPanel):
-       __idname__= "MATERIAL_PT_options"
        __label__ = "Options"
        COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
 
        def draw(self, context):
                layout = self.layout
+               
                mat = context.material
                
                split = layout.split()
                
-               sub = split.column()
-               sub.itemR(mat, "traceable")
-               sub.itemR(mat, "full_oversampling")
-               sub.itemR(mat, "sky")
-               sub.itemR(mat, "exclude_mist")
-               sub.itemR(mat, "invert_z")
-
-               col = sub.column(align=True)
-               col.itemL(text="Light Group:")
-               col.itemR(mat, "light_group", text="")
-               row = col.row()
+               col = split.column()
+               col.itemR(mat, "traceable")
+               col.itemR(mat, "full_oversampling")
+               col.itemR(mat, "sky")
+               col.itemR(mat, "exclude_mist")
+               col.itemR(mat, "invert_z")
+               sub = col.column(align=True)
+               sub.itemL(text="Light Group:")
+               sub.itemR(mat, "light_group", text="")
+               row = sub.row()
                row.active = mat.light_group
                row.itemR(mat, "light_group_exclusive", text="Exclusive")
 
-               sub = split.column()
-               sub.itemR(mat, "face_texture")
-               colsub = sub.column()
-               colsub.active = mat.face_texture
-               colsub.itemR(mat, "face_texture_alpha")
-               sub.itemR(mat, "vertex_color_paint")
-               sub.itemR(mat, "vertex_color_light")
-               sub.itemR(mat, "object_color")
+               col = split.column()
+               col.itemR(mat, "face_texture")
+               sub = col.column()
+               sub.active = mat.face_texture
+               sub.itemR(mat, "face_texture_alpha")
+               col.itemR(mat, "vertex_color_paint")
+               col.itemR(mat, "vertex_color_light")
+               col.itemR(mat, "object_color")
 
 class MATERIAL_PT_shadows(MaterialButtonsPanel):
-       __idname__= "MATERIAL_PT_shadows"
        __label__ = "Shadows"
        COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
 
        def draw(self, context):
                layout = self.layout
+               
                mat = context.material
                
                split = layout.split()
                
-               sub = split.column()
-               sub.itemR(mat, "shadows", text="Receive")
-               sub.itemR(mat, "transparent_shadows", text="Receive Transparent")
-               sub.itemR(mat, "only_shadow", text="Shadows Only")
-               sub.itemR(mat, "cast_shadows_only", text="Cast Only")
-               sub.itemR(mat, "shadow_casting_alpha", text="Casting Alpha", slider=True)
-               sub = split.column()
-               sub.itemR(mat, "ray_shadow_bias", text="Auto Ray Bias")
-               colsub = sub.column()
-               colsub.active = not mat.ray_shadow_bias
-               colsub.itemR(mat, "shadow_ray_bias", text="Ray Shadow Bias")
+               col = split.column()
+               col.itemR(mat, "shadows", text="Receive")
+               col.itemR(mat, "transparent_shadows", text="Receive Transparent")
+               col.itemR(mat, "only_shadow", text="Shadows Only")
+               col.itemR(mat, "cast_shadows_only", text="Cast Only")
+               col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha", slider=True)
+               
+               col = split.column()
+               col.itemR(mat, "ray_shadow_bias", text="Auto Ray Bias")
+               sub = col.column()
+               sub.active = not mat.ray_shadow_bias
+               sub.itemR(mat, "shadow_ray_bias", text="Ray Shadow Bias")
                sub.itemR(mat, "cast_buffer_shadows")
                sub.itemR(mat, "shadow_buffer_bias", text="Buffer Bias")
 
-
 class MATERIAL_PT_diffuse(MaterialButtonsPanel):
-       __idname__= "MATERIAL_PT_diffuse"
        __label__ = "Diffuse"
        COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
 
@@ -207,42 +203,41 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                mat = context.material  
                
                split = layout.split()
                
-               sub = split.column()
-               sub.itemR(mat, "diffuse_color", text="")
-               row = sub.row()
-               row.active = mat.shadeless== False
-               row.itemR(mat, "diffuse_reflection", text="Intensity", slider=True)
-               
-               sub = split.column()
+               col = split.column()
+               col.itemR(mat, "diffuse_color", text="")
+               sub = col.column()
                sub.active = mat.shadeless== False
-               sub.itemR(mat, "diffuse_shader", text="")
-               sub.itemR(mat, "use_diffuse_ramp", text="Ramp")
+               sub.itemR(mat, "diffuse_reflection", text="Intensity", slider=True)
                
-               split = layout.split()
-               split.active = mat.shadeless== False
-               sub = split.column()
+               col = split.column()
+               col.active = mat.shadeless== False
+               col.itemR(mat, "diffuse_shader", text="")
+               col.itemR(mat, "use_diffuse_ramp", text="Ramp")
+               
+               col = layout.column()
+               col.active = mat.shadeless== False
                if mat.diffuse_shader == 'OREN_NAYAR':
-                       sub.itemR(mat, "roughness")
-               if mat.diffuse_shader == 'MINNAERT':
-                       sub.itemR(mat, "darkness")
-               if mat.diffuse_shader == 'TOON':
-                       sub.itemR(mat, "diffuse_toon_size", text="Size")
-                       sub = split.column()
-                       sub.itemR(mat, "diffuse_toon_smooth", text="Smooth")
-               if mat.diffuse_shader == 'FRESNEL':
-                       sub.itemR(mat, "diffuse_fresnel", text="Fresnel")
-                       sub = split.column()
-                       sub.itemR(mat, "diffuse_fresnel_factor", text="Factor")
-               
-               if mat.use_diffuse_ramp:
+                       col.itemR(mat, "roughness")
+               elif mat.diffuse_shader == 'MINNAERT':
+                       col.itemR(mat, "darkness")
+               elif mat.diffuse_shader == 'TOON':
+                       row = col.row()
+                       row.itemR(mat, "diffuse_toon_size", text="Size")
+                       row.itemR(mat, "diffuse_toon_smooth", text="Smooth")
+               elif mat.diffuse_shader == 'FRESNEL':
+                       row = col.row()
+                       row.itemR(mat, "diffuse_fresnel", text="Fresnel")
+                       row.itemR(mat, "diffuse_fresnel_factor", text="Factor")
+                       
+               elif mat.use_diffuse_ramp:
                        layout.template_color_ramp(mat.diffuse_ramp, expand=True)
                
 class MATERIAL_PT_specular(MaterialButtonsPanel):
-       __idname__= "MATERIAL_PT_specular"
        __label__ = "Specular"
        COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
 
@@ -251,41 +246,39 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                mat = context.material
                
-               layout.active = mat.shadeless== False
+               layout.active = mat.shadeless == False
                
                split = layout.split()
                
-               sub = split.column()
-               sub.itemR(mat, "specular_color", text="")
-               sub.itemR(mat, "specular_reflection", text="Intensity", slider=True)
+               col = split.column()
+               col.itemR(mat, "specular_color", text="")
+               col.itemR(mat, "specular_reflection", text="Intensity", slider=True)
 
-               sub = split.column()
-               sub.itemR(mat, "specular_shader", text="")
-               sub.itemR(mat, "use_specular_ramp", text="Ramp")
-               
-               split = layout.split()
-               
-               sub = split.column()
+               col = split.column()
+               col.itemR(mat, "specular_shader", text="")
+               col.itemR(mat, "use_specular_ramp", text="Ramp")
+
+               col = layout.column()
                if mat.specular_shader in ('COOKTORR', 'PHONG'):
-                       sub.itemR(mat, "specular_hardness", text="Hardness")
-               if mat.specular_shader == 'BLINN':
-                       sub.itemR(mat, "specular_hardness", text="Hardness")
-                       sub = split.column()
-                       sub.itemR(mat, "specular_ior", text="IOR")
-               if mat.specular_shader == 'WARDISO':
-                       sub.itemR(mat, "specular_slope", text="Slope")
-               if mat.specular_shader == 'TOON':
-                       sub.itemR(mat, "specular_toon_size", text="Size")
-                       sub = split.column()
-                       sub.itemR(mat, "specular_toon_smooth", text="Smooth")
+                       col.itemR(mat, "specular_hardness", text="Hardness")
+               elif mat.specular_shader == 'BLINN':
+                       row = col.row()
+                       row.itemR(mat, "specular_hardness", text="Hardness")
+                       row.itemR(mat, "specular_ior", text="IOR")
+               elif mat.specular_shader == 'WARDISO':
+                       col.itemR(mat, "specular_slope", text="Slope")
+               elif mat.specular_shader == 'TOON':
+                       row = col.row()
+                       row.itemR(mat, "specular_toon_size", text="Size")
+                       row.itemR(mat, "specular_toon_smooth", text="Smooth")
                
                if mat.use_specular_ramp:
                        layout.template_color_ramp(mat.specular_ramp, expand=True)
                
 class MATERIAL_PT_sss(MaterialButtonsPanel):
-       __idname__= "MATERIAL_PT_sss"
        __label__ = "Subsurface Scattering"
        __default_closed__ = True
        COMPAT_ENGINES = set(['BLENDER_RENDER'])
@@ -301,30 +294,31 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
        
        def draw(self, context):
                layout = self.layout
-               sss = context.material.subsurface_scattering
+               
                mat = context.material
+               sss = context.material.subsurface_scattering
+
                layout.active = sss.enabled     
                
                split = layout.split()
                split.active = mat.shadeless== False
                
-               sub = split.column()
-               sub.itemR(sss, "color", text="")
-               sub.itemL(text="Blend:")
-               sub.itemR(sss, "color_factor", slider=True)
-               sub.itemR(sss, "texture_factor", slider=True)
-               sub.itemL(text="Scattering Weight:")
-               sub.itemR(sss, "front")
-               sub.itemR(sss, "back")
-               
-               sub = split.column()
-               sub.itemR(sss, "ior")
-               sub.itemR(sss, "scale")
-               sub.itemR(sss, "radius", text="RGB Radius")
-               sub.itemR(sss, "error_tolerance")
+               col = split.column()
+               col.itemR(sss, "color", text="")
+               col.itemL(text="Blend:")
+               col.itemR(sss, "color_factor", slider=True)
+               col.itemR(sss, "texture_factor", slider=True)
+               col.itemL(text="Scattering Weight:")
+               col.itemR(sss, "front")
+               col.itemR(sss, "back")
+               
+               col = split.column()
+               col.itemR(sss, "ior")
+               col.itemR(sss, "scale")
+               col.itemR(sss, "radius", text="RGB Radius")
+               col.itemR(sss, "error_tolerance")
 
 class MATERIAL_PT_raymir(MaterialButtonsPanel):
-       __idname__= "MATERIAL_PT_raymir"
        __label__ = "Ray Mirror"
        __default_closed__ = True
        COMPAT_ENGINES = set(['BLENDER_RENDER'])
@@ -334,32 +328,34 @@ class MATERIAL_PT_raymir(MaterialButtonsPanel):
        
        def draw_header(self, context):
                layout = self.layout
+               
                raym = context.material.raytrace_mirror
 
                layout.itemR(raym, "enabled", text="")
        
        def draw(self, context):
                layout = self.layout
-               raym = context.material.raytrace_mirror
+               
                mat = context.material
+               raym = context.material.raytrace_mirror
                
                layout.active = raym.enabled
                
                split = layout.split()
                
-               sub = split.column()
-               sub.itemR(raym, "reflect", text="Reflectivity", slider=True)
-               sub.itemR(mat, "mirror_color", text="")
-               sub.itemR(raym, "fresnel")
-               sub.itemR(raym, "fresnel_fac", text="Fac", slider=True)
+               col = split.column()
+               col.itemR(raym, "reflect", text="Reflectivity", slider=True)
+               col.itemR(mat, "mirror_color", text="")
+               col.itemR(raym, "fresnel")
+               col.itemR(raym, "fresnel_fac", text="Fac", slider=True)
                
-               sub = split.column()
-               sub.itemR(raym, "gloss", slider=True)
-               colsub = sub.column()
-               colsub.active = raym.gloss < 1
-               colsub.itemR(raym, "gloss_threshold", slider=True, text="Threshold")
-               colsub.itemR(raym, "gloss_samples", text="Samples")
-               colsub.itemR(raym, "gloss_anisotropic", slider=True, text="Anisotropic")
+               col = split.column()
+               col.itemR(raym, "gloss", slider=True)
+               sub = col.column()
+               sub.active = raym.gloss < 1
+               sub.itemR(raym, "gloss_threshold", slider=True, text="Threshold")
+               sub.itemR(raym, "gloss_samples", text="Samples")
+               sub.itemR(raym, "gloss_anisotropic", slider=True, text="Anisotropic")
                
                row = layout.row()
                row.itemR(raym, "distance", text="Max Dist")
@@ -368,7 +364,6 @@ class MATERIAL_PT_raymir(MaterialButtonsPanel):
                layout.itemR(raym, "fade_to")
                
 class MATERIAL_PT_raytransp(MaterialButtonsPanel):
-       __idname__= "MATERIAL_PT_raytransp"
        __label__= "Ray Transparency"
        __default_closed__ = True
        COMPAT_ENGINES = set(['BLENDER_RENDER'])
@@ -378,34 +373,34 @@ class MATERIAL_PT_raytransp(MaterialButtonsPanel):
 
        def draw_header(self, context):
                layout = self.layout
+               
                rayt = context.material.raytrace_transparency
 
                layout.itemR(rayt, "enabled", text="")
 
        def draw(self, context):
                layout = self.layout
-               rayt = context.material.raytrace_transparency
+               
                mat = context.material
+               rayt = context.material.raytrace_transparency
                
-               layout.active = rayt.enabled    
+               layout.active = rayt.enabled and mat.shadeless = False
                
                split = layout.split()
-               split.active = mat.shadeless== False
                
-               sub = split.column()
-               sub.itemR(rayt, "ior")
-               sub.itemR(rayt, "fresnel")
-               sub.itemR(rayt, "fresnel_fac", text="Fac", slider=True)
+               col = split.column()
+               col.itemR(rayt, "ior")
+               col.itemR(rayt, "fresnel")
+               col.itemR(rayt, "fresnel_fac", text="Fac", slider=True)
                
-               sub = split.column()
-               sub.itemR(rayt, "gloss", slider=True)
-               colsub = sub.column()
-               colsub.active = rayt.gloss < 1
-               colsub.itemR(rayt, "gloss_threshold", slider=True, text="Threshold")
-               colsub.itemR(rayt, "gloss_samples", text="Samples")
+               col = split.column()
+               col.itemR(rayt, "gloss", slider=True)
+               sub = col.column()
+               sub.active = rayt.gloss < 1
+               sub.itemR(rayt, "gloss_threshold", slider=True, text="Threshold")
+               sub.itemR(rayt, "gloss_samples", text="Samples")
                
                flow = layout.column_flow()
-               flow.active = mat.shadeless== False
                flow.itemR(rayt, "filter", slider=True)
                flow.itemR(rayt, "limit")
                flow.itemR(rayt, "falloff")
@@ -413,7 +408,6 @@ class MATERIAL_PT_raytransp(MaterialButtonsPanel):
                flow.itemR(rayt, "depth")
                
 class MATERIAL_PT_halo(MaterialButtonsPanel):
-       __idname__= "MATERIAL_PT_halo"
        __label__= "Halo"
        COMPAT_ENGINES = set(['BLENDER_RENDER'])
        
@@ -433,7 +427,6 @@ class MATERIAL_PT_halo(MaterialButtonsPanel):
                col.itemR(halo, "size")
                col.itemR(halo, "hardness")
                col.itemR(halo, "add", slider=True)
-               
                col.itemL(text="Options:")
                col.itemR(halo, "use_texture", text="Texture")
                col.itemR(halo, "use_vertex_normal", text="Vertex Normal")
@@ -442,30 +435,28 @@ class MATERIAL_PT_halo(MaterialButtonsPanel):
                col.itemR(halo, "soft")
 
                col = split.column()
-               col = col.column()
                col.itemR(halo, "ring")
-               colsub = col.column()
-               colsub.active = halo.ring
-               colsub.itemR(halo, "rings")
-               colsub.itemR(mat, "mirror_color", text="")
+               sub = col.column()
+               sub.active = halo.ring
+               sub.itemR(halo, "rings")
+               sub.itemR(mat, "mirror_color", text="")
                col.itemR(halo, "lines")
-               colsub = col.column()
-               colsub.active = halo.lines
-               colsub.itemR(halo, "line_number", text="Lines")
-               colsub.itemR(mat, "specular_color", text="")
+               sub = col.column()
+               sub.active = halo.lines
+               sub.itemR(halo, "line_number", text="Lines")
+               sub.itemR(mat, "specular_color", text="")
                col.itemR(halo, "star")
-               colsub = col.column()
-               colsub.active = halo.star
-               colsub.itemR(halo, "star_tips")
+               sub = col.column()
+               sub.active = halo.star
+               sub.itemR(halo, "star_tips")
                col.itemR(halo, "flare_mode")
-               colsub = col.column()
-               colsub.active = halo.flare_mode
-               colsub.itemR(halo, "flare_size", text="Size")
-               colsub.itemR(halo, "flare_subsize", text="Subsize")
-               colsub.itemR(halo, "flare_boost", text="Boost")
-               colsub.itemR(halo, "flare_seed", text="Seed")
-               colsub.itemR(halo, "flares_sub", text="Sub")
-
+               sub = col.column()
+               sub.active = halo.flare_mode
+               sub.itemR(halo, "flare_size", text="Size")
+               sub.itemR(halo, "flare_subsize", text="Subsize")
+               sub.itemR(halo, "flare_boost", text="Boost")
+               sub.itemR(halo, "flare_seed", text="Seed")
+               sub.itemR(halo, "flares_sub", text="Sub")
 
 bpy.types.register(MATERIAL_PT_context_material)
 bpy.types.register(MATERIAL_PT_preview)
index b2c8105f2bbc7e866f0350646bf364b831eb18f4..d59ed604c55f034569258ea7d4f07a85794c9880 100644 (file)
@@ -11,6 +11,7 @@ class OBJECT_PT_context_object(ObjectButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                ob = context.object
                
                row = layout.row()
@@ -22,6 +23,7 @@ class OBJECT_PT_transform(ObjectButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                ob = context.object
 
                row = layout.row()
@@ -34,9 +36,11 @@ class OBJECT_PT_relations(ObjectButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                ob = context.object
 
                split = layout.split()
+               
                col = split.column()
                col.itemR(ob, "layers")
                col.itemS()
@@ -58,6 +62,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                ob = context.object
 
                split = layout.split()
@@ -83,6 +88,7 @@ class OBJECT_PT_display(ObjectButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                ob = context.object
                        
                row = layout.row()
@@ -102,6 +108,7 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                ob = context.object
 
                layout.itemR(ob, "dupli_type", expand=True)
@@ -109,13 +116,13 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
                if ob.dupli_type == 'FRAMES':
                        split = layout.split()
                        
-                       sub = split.column(align=True)
-                       sub.itemR(ob, "dupli_frames_start", text="Start")
-                       sub.itemR(ob, "dupli_frames_end", text="End")
+                       col = split.column(align=True)
+                       col.itemR(ob, "dupli_frames_start", text="Start")
+                       col.itemR(ob, "dupli_frames_end", text="End")
                        
-                       sub = split.column(align=True)
-                       sub.itemR(ob, "dupli_frames_on", text="On")
-                       sub.itemR(ob, "dupli_frames_off", text="Off")
+                       col = split.column(align=True)
+                       col.itemR(ob, "dupli_frames_on", text="On")
+                       col.itemR(ob, "dupli_frames_off", text="Off")
                        
                        layout.itemR(ob, "dupli_frames_no_speed", text="No Speed")
 
@@ -135,30 +142,31 @@ class OBJECT_PT_animation(ObjectButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                ob = context.object
                
                split = layout.split()
                
-               sub = split.column()
-               sub.itemL(text="Time Offset:")
-               sub.itemR(ob, "time_offset_edit", text="Edit")
-               row = sub.row()
+               col = split.column()
+               col.itemL(text="Time Offset:")
+               col.itemR(ob, "time_offset_edit", text="Edit")
+               row = col.row()
                row.itemR(ob, "time_offset_particle", text="Particle")
                row.active = len(ob.particle_systems) != 0
-               row = sub.row()
+               row = col.row()
                row.itemR(ob, "time_offset_parent", text="Parent")
                row.active = ob.parent != None
-               row = sub.row()
+               row = col.row()
                row.itemR(ob, "slow_parent")
                row.active = ob.parent != None
-               sub.itemR(ob, "time_offset", text="Offset")
-
-               sub = split.column()
-               sub.itemL(text="Track:")
-               sub.itemR(ob, "track", text="")
-               sub.itemR(ob, "track_axis", text="Axis")
-               sub.itemR(ob, "up_axis", text="Up Axis")
-               row = sub.row()
+               col.itemR(ob, "time_offset", text="Offset")
+
+               col = split.column()
+               col.itemL(text="Track:")
+               col.itemR(ob, "track", text="")
+               col.itemR(ob, "track_axis", text="Axis")
+               col.itemR(ob, "up_axis", text="Up Axis")
+               row = col.row()
                row.itemR(ob, "track_override_parent", text="Override Parent")
                row.active = ob.parent != None
 
index b239a96a16adb0ffa36400c36a777456baab3f21..3804ef5d4096a49e76ad52de3832603219672bde 100644 (file)
@@ -8,6 +8,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
 
        def draw_constraint(self, con):
                layout = self.layout
+               
                box = layout.template_constraint(con)
 
                if box:
@@ -91,23 +92,23 @@ class ConstraintButtonsPanel(bpy.types.Panel):
 
                split = layout.split()
                
-               sub = split.column()
-               sub.itemL(text="Location:")
-               sub.itemR(con, "locationx", text="X")
-               sub.itemR(con, "locationy", text="Y")
-               sub.itemR(con, "locationz", text="Z")
+               col = split.column()
+               col.itemL(text="Location:")
+               col.itemR(con, "locationx", text="X")
+               col.itemR(con, "locationy", text="Y")
+               col.itemR(con, "locationz", text="Z")
                
-               sub = split.column()
-               sub.itemL(text="Rotation:")
-               sub.itemR(con, "rotationx", text="X")
-               sub.itemR(con, "rotationy", text="Y")
-               sub.itemR(con, "rotationz", text="Z")
+               col = split.column()
+               col.itemL(text="Rotation:")
+               col.itemR(con, "rotationx", text="X")
+               col.itemR(con, "rotationy", text="Y")
+               col.itemR(con, "rotationz", text="Z")
                
-               sub = split.column()
-               sub.itemL(text="Scale:")
-               sub.itemR(con, "sizex", text="X")
-               sub.itemR(con, "sizey", text="Y")
-               sub.itemR(con, "sizez", text="Z")
+               col = split.column()
+               col.itemL(text="Scale:")
+               col.itemR(con, "sizex", text="X")
+               col.itemR(con, "sizey", text="Y")
+               col.itemR(con, "sizez", text="Z")
                
                row = layout.row()
                row.itemO("constraint.childof_set_inverse")
@@ -134,18 +135,18 @@ class ConstraintButtonsPanel(bpy.types.Panel):
                if con.pole_target and con.pole_target.type == "ARMATURE":
                        layout.item_pointerR(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
                
-               col = layout.column_flow()
-               col.itemR(con, "iterations")
-               col.itemR(con, "pole_angle")
-               col.itemR(con, "weight")
-               col.itemR(con, "orient_weight")
-               col.itemR(con, "chain_length")
+               flow = layout.column_flow()
+               flow.itemR(con, "iterations")
+               flow.itemR(con, "pole_angle")
+               flow.itemR(con, "weight")
+               flow.itemR(con, "orient_weight")
+               flow.itemR(con, "chain_length")
                
-               col = layout.column_flow()
-               col.itemR(con, "tail")
-               col.itemR(con, "rotation")
-               col.itemR(con, "targetless")
-               col.itemR(con, "stretch")
+               flow = layout.column_flow()
+               flow.itemR(con, "tail")
+               flow.itemR(con, "rotation")
+               flow.itemR(con, "targetless")
+               flow.itemR(con, "stretch")
                
        def follow_path(self, layout, con):
                self.target_template(layout, con)
@@ -168,24 +169,24 @@ class ConstraintButtonsPanel(bpy.types.Panel):
                
                col = split.column()
                col.itemR(con, "use_limit_x")
-               colsub = col.column()
-               colsub.active = con.use_limit_x
-               colsub.itemR(con, "minimum_x", text="Min")
-               colsub.itemR(con, "maximum_x", text="Max")
+               sub = col.column()
+               sub.active = con.use_limit_x
+               sub.itemR(con, "minimum_x", text="Min")
+               sub.itemR(con, "maximum_x", text="Max")
                
                col = split.column()
                col.itemR(con, "use_limit_y")
-               colsub = col.column()
-               colsub.active = con.use_limit_y
-               colsub.itemR(con, "minimum_y", text="Min")
-               colsub.itemR(con, "maximum_y", text="Max")
+               sub = col.column()
+               sub.active = con.use_limit_y
+               sub.itemR(con, "minimum_y", text="Min")
+               sub.itemR(con, "maximum_y", text="Max")
                
                col = split.column()
                col.itemR(con, "use_limit_z")
-               colsub = col.column()
-               colsub.active = con.use_limit_z
-               colsub.itemR(con, "minimum_z", text="Min")
-               colsub.itemR(con, "maximum_z", text="Max")
+               sub = col.column()
+               sub.active = con.use_limit_z
+               sub.itemR(con, "minimum_z", text="Min")
+               sub.itemR(con, "maximum_z", text="Max")
                
                row = layout.row()
                row.itemR(con, "limit_transform")
@@ -200,33 +201,33 @@ class ConstraintButtonsPanel(bpy.types.Panel):
                
                col = split.column()
                col.itemR(con, "use_minimum_x")
-               colsub = col.column()
-               colsub.active = con.use_minimum_x
-               colsub.itemR(con, "minimum_x", text="")
+               sub = col.column()
+               sub.active = con.use_minimum_x
+               sub.itemR(con, "minimum_x", text="")
                col.itemR(con, "use_maximum_x")
-               colsub = col.column()
-               colsub.active = con.use_maximum_x
-               colsub.itemR(con, "maximum_x", text="")
+               sub = col.column()
+               sub.active = con.use_maximum_x
+               sub.itemR(con, "maximum_x", text="")
                
                col = split.column()
                col.itemR(con, "use_minimum_y")
-               colsub = col.column()
-               colsub.active = con.use_minimum_y
-               colsub.itemR(con, "minimum_y", text="")
+               sub = col.column()
+               sub.active = con.use_minimum_y
+               sub.itemR(con, "minimum_y", text="")
                col.itemR(con, "use_maximum_y")
-               colsub = col.column()
-               colsub.active = con.use_maximum_y
-               colsub.itemR(con, "maximum_y", text="")
+               sub = col.column()
+               sub.active = con.use_maximum_y
+               sub.itemR(con, "maximum_y", text="")
                
                col = split.column()
                col.itemR(con, "use_minimum_z")
-               colsub = col.column()
-               colsub.active = con.use_minimum_z
-               colsub.itemR(con, "minimum_z", text="")
+               sub = col.column()
+               sub.active = con.use_minimum_z
+               sub.itemR(con, "minimum_z", text="")
                col.itemR(con, "use_maximum_z")
-               colsub = col.column()
-               colsub.active = con.use_maximum_z
-               colsub.itemR(con, "maximum_z", text="")
+               sub = col.column()
+               sub.active = con.use_maximum_z
+               sub.itemR(con, "maximum_z", text="")
        
                row = layout.row()
                row.itemR(con, "limit_transform")
@@ -241,33 +242,33 @@ class ConstraintButtonsPanel(bpy.types.Panel):
 
                col = split.column()
                col.itemR(con, "use_minimum_x")
-               colsub = col.column()
-               colsub.active = con.use_minimum_x
-               colsub.itemR(con, "minimum_x", text="")
+               sub = col.column()
+               sub.active = con.use_minimum_x
+               sub.itemR(con, "minimum_x", text="")
                col.itemR(con, "use_maximum_x")
-               colsub = col.column()
-               colsub.active = con.use_maximum_x
-               colsub.itemR(con, "maximum_x", text="")
+               sub = col.column()
+               sub.active = con.use_maximum_x
+               sub.itemR(con, "maximum_x", text="")
                
                col = split.column()
                col.itemR(con, "use_minimum_y")
-               colsub = col.column()
-               colsub.active = con.use_minimum_y
-               colsub.itemR(con, "minimum_y", text="")
+               sub = col.column()
+               sub.active = con.use_minimum_y
+               sub.itemR(con, "minimum_y", text="")
                col.itemR(con, "use_maximum_y")
-               colsub = col.column()
-               colsub.active = con.use_maximum_y
-               colsub.itemR(con, "maximum_y", text="")
+               sub = col.column()
+               sub.active = con.use_maximum_y
+               sub.itemR(con, "maximum_y", text="")
                
                col = split.column()
                col.itemR(con, "use_minimum_z")
-               colsub = col.column()
-               colsub.active = con.use_minimum_z
-               colsub.itemR(con, "minimum_z", text="")
+               sub = col.column()
+               sub.active = con.use_minimum_z
+               sub.itemR(con, "minimum_z", text="")
                col.itemR(con, "use_maximum_z")
-               colsub = col.column()
-               colsub.active = con.use_maximum_z
-               colsub.itemR(con, "maximum_z", text="")
+               sub = col.column()
+               sub.active = con.use_maximum_z
+               sub.itemR(con, "maximum_z", text="")
                
                row = layout.row()
                row.itemR(con, "limit_transform")
@@ -284,21 +285,21 @@ class ConstraintButtonsPanel(bpy.types.Panel):
                
                col = split.column()
                col.itemR(con, "rotate_like_x", text="X")
-               colsub = col.column()
-               colsub.active = con.rotate_like_x
-               colsub.itemR(con, "invert_x", text="Invert")
+               sub = col.column()
+               sub.active = con.rotate_like_x
+               sub.itemR(con, "invert_x", text="Invert")
                
                col = split.column()
                col.itemR(con, "rotate_like_y", text="Y")
-               colsub = col.column()
-               colsub.active = con.rotate_like_y
-               colsub.itemR(con, "invert_y", text="Invert")
+               sub = col.column()
+               sub.active = con.rotate_like_y
+               sub.itemR(con, "invert_y", text="Invert")
                
                col = split.column()
                col.itemR(con, "rotate_like_z", text="Z")
-               colsub = col.column()
-               colsub.active = con.rotate_like_z
-               colsub.itemR(con, "invert_z", text="Invert")
+               sub = col.column()
+               sub.active = con.rotate_like_z
+               sub.itemR(con, "invert_z", text="Invert")
 
                layout.itemR(con, "offset")
                
@@ -311,21 +312,21 @@ class ConstraintButtonsPanel(bpy.types.Panel):
                
                col = split.column()
                col.itemR(con, "locate_like_x", text="X")
-               colsub = col.column()
-               colsub.active = con.locate_like_x
-               colsub.itemR(con, "invert_x", text="Invert")
+               sub = col.column()
+               sub.active = con.locate_like_x
+               sub.itemR(con, "invert_x", text="Invert")
                
                col = split.column()
                col.itemR(con, "locate_like_y", text="Y")
-               colsub = col.column()
-               colsub.active = con.locate_like_y
-               colsub.itemR(con, "invert_y", text="Invert")
+               sub = col.column()
+               sub.active = con.locate_like_y
+               sub.itemR(con, "invert_y", text="Invert")
                
                col = split.column()
                col.itemR(con, "locate_like_z", text="Z")
-               colsub = col.column()
-               colsub.active = con.locate_like_z
-               colsub.itemR(con, "invert_z", text="Invert")
+               sub = col.column()
+               sub.active = con.locate_like_z
+               sub.itemR(con, "invert_z", text="Invert")
 
                layout.itemR(con, "offset")
                        
@@ -516,11 +517,11 @@ class OBJECT_PT_constraints(ConstraintButtonsPanel):
        __context__ = "constraint"
 
        def poll(self, context):
-               return (context.object != None)
+               return (context.object)
                
        def draw(self, context):
-               ob = context.object
                layout = self.layout
+               ob = context.object
 
                row = layout.row()
                row.item_menu_enumO("object.constraint_add", "type")
@@ -538,9 +539,10 @@ class BONE_PT_constraints(ConstraintButtonsPanel):
                return (ob and ob.type == "ARMATURE" and context.bone)
                
        def draw(self, context):
+               layout = self.layout
+               
                ob = context.object
                pchan = ob.pose.pose_channels[context.bone.name]
-               layout = self.layout
 
                row = layout.row()
                row.item_menu_enumO("pose.constraint_add", "type")
index 180133f599e54cf5034f54490f4ce187e1f15eba..b9c81042a13d688f578355f694380f90d4f8adcf 100644 (file)
@@ -16,6 +16,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                ob = context.object
                field = ob.field
 
@@ -24,65 +25,67 @@ class PHYSICS_PT_field(PhysicButtonsPanel):
                split = layout.split(percentage=0.3)
                
                split.itemL(text="Type:")
-               split.itemR(field, "type", text=""
-               )
+               split.itemR(field, "type", text="")
 
                split = layout.split()
                
-               sub = split.column()
+               col = split.column()
                                                        
                if field.type == "GUIDE":
-                       sub = col.column()
-                       sub.itemR(field, "guide_path_add")
+                       col.itemR(field, "guide_path_add")
+                       
+               elif field.type == "WIND":
+                       col.itemR(field, "strength")
                        
-               if field.type == "WIND":
-                       sub.itemR(field, "strength")
-                       sub = split.column()
-                       sub.itemR(field, "noise")
-                       sub.itemR(field, "seed")
+                       col = split.column()
+                       col.itemR(field, "noise")
+                       col.itemR(field, "seed")
 
-               
-               if field.type == "VORTEX":
-                       sub.itemR(field, "strength")
-                       sub = split.column()
-                       sub.itemL(text="")
+               elif field.type == "VORTEX":
+                       col.itemR(field, "strength")
+                       
+                       col = split.column()
+                       col.itemL(text="")
 
-               if field.type in ("SPHERICAL", "CHARGE", "LENNARDJ"):
-                       sub.itemR(field, "strength")
-                       sub = split.column()
-                       sub.itemR(field, "planar")
-                       sub.itemR(field, "surface")
-                       
-               if field.type == "BOID":
-                       sub.itemR(field, "strength")
-                       sub = split.column()
-                       sub.itemR(field, "surface")
-                       
-               if field.type == "MAGNET":
-                       sub.itemR(field, "strength")
-                       sub = split.column()
-                       sub.itemR(field, "planar")
-                       
-               if field.type == "HARMONIC":
-                       sub.itemR(field, "strength")
-                       sub.itemR(field, "harmonic_damping", text="Damping")
-                       sub = split.column()
-                       sub.itemR(field, "surface")
-                       sub.itemR(field, "planar")
-                       
-               if field.type == "TEXTURE":
-                       sub.itemR(field, "strength")
-                       sub.itemR(field, "texture", text="")
-                       sub.itemR(field, "texture_mode")
-                       sub.itemR(field, "texture_nabla")
-                       sub = split.column()
-                       sub.itemR(field, "use_coordinates")
-                       sub.itemR(field, "root_coordinates")
-                       sub.itemR(field, "force_2d")
+               elif field.type in ("SPHERICAL", "CHARGE", "LENNARDJ"):
+                       col.itemR(field, "strength")
                        
-               if field.type in ("HARMONIC", "SPHERICAL", "CHARGE", "WIND", "VORTEX", "TEXTURE", "MAGNET", "BOID"):
-               
+                       col = split.column()
+                       col.itemR(field, "planar")
+                       col.itemR(field, "surface")
+                       
+               elif field.type == "BOID":
+                       col.itemR(field, "strength")
+                       
+                       col = split.column()
+                       col.itemR(field, "surface")
+                       
+               elif field.type == "MAGNET":
+                       col.itemR(field, "strength")
+                       
+                       col = split.column()
+                       col.itemR(field, "planar")
+                       
+               elif field.type == "HARMONIC":
+                       col.itemR(field, "strength")
+                       col.itemR(field, "harmonic_damping", text="Damping")
                        
+                       col = split.column()
+                       col.itemR(field, "surface")
+                       col.itemR(field, "planar")
+                       
+               elif field.type == "TEXTURE":
+                       col.itemR(field, "strength")
+                       col.itemR(field, "texture", text="")
+                       col.itemR(field, "texture_mode")
+                       col.itemR(field, "texture_nabla")
+                       
+                       col = split.column()
+                       col.itemR(field, "use_coordinates")
+                       col.itemR(field, "root_coordinates")
+                       col.itemR(field, "force_2d")
+                       
+               if field.type in ("HARMONIC", "SPHERICAL", "CHARGE", "WIND", "VORTEX", "TEXTURE", "MAGNET", "BOID"):
                        layout.itemS()                  
                        layout.itemL(text="Falloff:")
                        layout.itemR(field, "falloff_type", expand=True)
@@ -93,19 +96,18 @@ class PHYSICS_PT_field(PhysicButtonsPanel):
                        
                        layout.itemS()  
                        split = layout.split()
-                       sub = split.column()
-                       
-                       sub.itemR(field, "use_min_distance", text="Minimum")
-                       colsub1 = sub.column()
-                       colsub1.active = field.use_min_distance
-                       colsub1.itemR(field, "minimum_distance", text="Distance")
                        
-                       sub = split.column()
+                       col = split.column()
+                       col.itemR(field, "use_min_distance", text="Minimum")
+                       sub = col.column()
+                       sub.active = field.use_min_distance
+                       sub.itemR(field, "minimum_distance", text="Distance")
                        
-                       sub.itemR(field, "use_max_distance", text="Maximum")
-                       colsub2 = sub.column()
-                       colsub2.active = field.use_max_distance
-                       colsub2.itemR(field, "maximum_distance", text="Distance")
+                       col = split.column()
+                       col.itemR(field, "use_max_distance", text="Maximum")
+                       sub = col.column()
+                       sub.active = field.use_max_distance
+                       sub.itemR(field, "maximum_distance", text="Distance")
                        
                        if field.falloff_type == "CONE":
                                layout.itemS()  
@@ -113,45 +115,43 @@ class PHYSICS_PT_field(PhysicButtonsPanel):
                                
                                row = layout.row()
                                row.itemR(field, "radial_falloff", text="Power")
-                               row.itemL(text="")
+                               row.itemL()
                                
                                split = layout.split()
-                               sub = split.column()
-                               
-                               sub.itemR(field, "use_radial_min", text="Minimum")      
-                               colsub1 = sub.column()
-                               colsub1.active = field.use_radial_min
-                               colsub1.itemR(field, "radial_minimum", text="Angle")
-                               
-                               sub = split.column()
                                
-                               sub.itemR(field, "use_radial_max", text="Maximum")
-                               colsub2 = sub.column()
-                               colsub2.active = field.use_radial_max
-                               colsub2.itemR(field, "radial_maximum", text="Angle")
+                               col = split.column()
+                               col.itemR(field, "use_radial_min", text="Minimum")      
+                               sub = col.column()
+                               sub.active = field.use_radial_min
+                               sub.itemR(field, "radial_minimum", text="Angle")
                                
-                       if field.falloff_type == "TUBE":
+                               col = split.column()
+                               col.itemR(field, "use_radial_max", text="Maximum")
+                               sub = col.column()
+                               sub.active = field.use_radial_max
+                               sub.itemR(field, "radial_maximum", text="Angle")
                                
+                       elif field.falloff_type == "TUBE":
                                layout.itemS()  
                                layout.itemL(text="Radial:")    
+                               
                                row = layout.row()
                                row.itemR(field, "radial_falloff", text="Power")
-                               row.itemL(text="")
+                               row.itemL()
                                
                                split = layout.split()
-                               sub = split.column()
-                               
-                               sub.itemR(field, "use_radial_min", text="Minimum")      
-                               colsub1 = sub.column()
-                               colsub1.active = field.use_radial_min
-                               colsub1.itemR(field, "radial_minimum", text="Distance")
                                
-                               sub = split.column()
+                               col = split.column()
+                               col.itemR(field, "use_radial_min", text="Minimum")      
+                               sub = col.column()
+                               sub.active = field.use_radial_min
+                               sub.itemR(field, "radial_minimum", text="Distance")
                                
-                               sub.itemR(field, "use_radial_max", text="Maximum")
-                               colsub2 = sub.column()
-                               colsub2.active = field.use_radial_max
-                               colsub2.itemR(field, "radial_maximum", text="Distance")
+                               col = split.column()
+                               col.itemR(field, "use_radial_max", text="Maximum")
+                               sub = col.column()
+                               sub.active = field.use_radial_max
+                               sub.itemR(field, "radial_maximum", text="Distance")
                                
                #if ob.type in "CURVE":
                        #if field.type == "GUIDE":
@@ -179,6 +179,7 @@ class PHYSICS_PT_collision(PhysicButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                md = context.collision
                settings = context.object.collision
 
@@ -190,25 +191,25 @@ class PHYSICS_PT_collision(PhysicButtonsPanel):
                col.itemL(text="Particle:")
                col.itemR(settings, "permeability", slider=True)
                col.itemL(text="Particle Damping:")
-               colsub = col.column(align=True)
-               colsub.itemR(settings, "damping_factor", text="Factor", slider=True)
-               colsub.itemR(settings, "random_damping", text="Random", slider=True)
+               sub = col.column(align=True)
+               sub.itemR(settings, "damping_factor", text="Factor", slider=True)
+               sub.itemR(settings, "random_damping", text="Random", slider=True)
                
                col.itemL(text="Soft Body and Cloth:")
-               colsub = col.column(align=True)
-               colsub.itemR(settings, "outer_thickness", text="Outer", slider=True)
-               colsub.itemR(settings, "inner_thickness", text="Inner", slider=True)
+               sub = col.column(align=True)
+               sub.itemR(settings, "outer_thickness", text="Outer", slider=True)
+               sub.itemR(settings, "inner_thickness", text="Inner", slider=True)
                
-               col.itemL(text="Force Fields:")
+               layout.itemL(text="Force Fields:")
                layout.itemR(md, "absorption", text="Absorption")
                
                col = split.column()
                col.itemL(text="")
                col.itemR(settings, "kill_particles")
                col.itemL(text="Particle Friction:")
-               colsub = col.column(align=True)
-               colsub.itemR(settings, "friction_factor", text="Factor", slider=True)
-               colsub.itemR(settings, "random_friction", text="Random", slider=True)
+               sub = col.column(align=True)
+               sub.itemR(settings, "friction_factor", text="Factor", slider=True)
+               sub.itemR(settings, "random_friction", text="Random", slider=True)
                col.itemL(text="Soft Body Damping:")
                col.itemR(settings, "damping", text="Factor", slider=True)
                
index 1f56c423c13302e7a3e1f730f806614c226f2c1a..33979faa4a7114521076b488ca5ee8747368b831 100644 (file)
@@ -16,6 +16,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                md = context.fluid
                ob = context.object
 
@@ -42,9 +43,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
                
                
                if fluid:
-                       
-                       col = layout.column(align=True)
-                       col.itemR(fluid, "type")
+                       layout.itemR(fluid, "type")
 
                        if fluid.type == 'DOMAIN':
                                layout.itemO("fluid.bake", text="BAKE")
@@ -52,56 +51,59 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
                                
                                col = split.column()
                                col.itemL(text="Resolution:")
-                               colsub = col.column()
-                               colsub.itemR(fluid, "resolution", text="Final")
-                               colsub.itemL(text="Render Display:")
-                               colsub.itemR(fluid, "render_display_mode", text="")
+                               sub = col.column()
+                               sub.itemR(fluid, "resolution", text="Final")
+                               sub.itemL(text="Render Display:")
+                               sub.itemR(fluid, "render_display_mode", text="")
                                col.itemL(text="Time:")
-                               colsub = col.column(align=True)
-                               colsub.itemR(fluid, "start_time", text="Start")
-                               colsub.itemR(fluid, "end_time", text="End")
+                               sub = col.column(align=True)
+                               sub.itemR(fluid, "start_time", text="Start")
+                               sub.itemR(fluid, "end_time", text="End")
                                
                                col = split.column()
-                               colsub = col.column()
-                               colsub.itemL(text="Required Memory: " + fluid.memory_estimate)
-                               colsub.itemR(fluid, "preview_resolution", text="Preview")
-                               colsub.itemL(text="Viewport Display:")
-                               colsub.itemR(fluid, "viewport_display_mode", text="")
-                               colsub = col.column()
-                               colsub.itemL(text="")
-                               colsub.itemR(fluid, "reverse_frames")
-                               colsub.itemR(fluid, "generate_speed_vectors")
+                               col.itemL(text="Required Memory: " + fluid.memory_estimate)
+                               col.itemR(fluid, "preview_resolution", text="Preview")
+                               col.itemL(text="Viewport Display:")
+                               col.itemR(fluid, "viewport_display_mode", text="")
+                               col.itemL()
+                               col.itemR(fluid, "reverse_frames")
+                               col.itemR(fluid, "generate_speed_vectors")
                                
                                layout.itemL(text="Path:")
                                layout.itemR(fluid, "path", text="")
                                
-                       if fluid.type == 'FLUID':
+                       elif fluid.type == 'FLUID':
                                split = layout.split()
+                               
                                col = split.column()
                                col.itemL(text="Volume Initialization:")
                                col.itemR(fluid, "volume_initialization", text="")
                                col.itemR(fluid, "export_animated_mesh")
+                               
                                col = split.column()
                                col.itemL(text="Initial Velocity:")
                                col.itemR(fluid, "initial_velocity", text="")
                                
-                       if fluid.type == 'OBSTACLE':
+                       elif fluid.type == 'OBSTACLE':
                                split = layout.split()
+                               
                                col = split.column()
                                col.itemL(text="Volume Initialization:")
                                col.itemR(fluid, "volume_initialization", text="")
                                col.itemR(fluid, "export_animated_mesh")
+                               
                                col = split.column()
                                col.itemL(text="Slip Type:")
-                               colsub=col.column(align=True)
-                               colsub.itemR(fluid, "slip_type", text="")
+                               sub = col.column(align=True)
+                               sub.itemR(fluid, "slip_type", text="")
                                if fluid.slip_type == 'PARTIALSLIP':
-                                       colsub.itemR(fluid, "partial_slip_amount", slider=True, text="Amount")
+                                       sub.itemR(fluid, "partial_slip_amount", slider=True, text="Amount")
                                        
                                col.itemR(fluid, "impact_factor")
                                
-                       if fluid.type == 'INFLOW':
+                       elif fluid.type == 'INFLOW':
                                split = layout.split()
+                               
                                col = split.column()
                                col.itemL(text="Volume Initialization:")
                                col.itemR(fluid, "volume_initialization", text="")
@@ -112,24 +114,26 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
                                col.itemL(text="Inflow Velocity:")
                                col.itemR(fluid, "inflow_velocity", text="")
                                
-                       if fluid.type == 'OUTFLOW':
+                       elif fluid.type == 'OUTFLOW':
                                split = layout.split()
+                               
                                col = split.column()
                                col.itemL(text="Volume Initialization:")
                                col.itemR(fluid, "volume_initialization", text="")
                                col.itemR(fluid, "export_animated_mesh")
-                               col = split.column()
                                
-                       if fluid.type == 'PARTICLE':
+                               split.column()
+                               
+                       elif fluid.type == 'PARTICLE':
                                split = layout.split()
                                
                                col = split.column()
                                col.itemL(text="Influence:")
-                               colsub = col.column(align=True)
-                               colsub.itemR(fluid, "particle_influence", text="Size")
-                               colsub.itemR(fluid, "alpha_influence", text="Alpha")
-                               col.itemL(text="Path:")
+                               sub = col.column(align=True)
+                               sub.itemR(fluid, "particle_influence", text="Size")
+                               sub.itemR(fluid, "alpha_influence", text="Alpha")
                                
+                               layout.itemL(text="Path:")
                                layout.itemR(fluid, "path", text="")
                                
                                col = split.column()
@@ -138,7 +142,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
                                col.itemR(fluid, "floats")
                                col.itemR(fluid, "tracer")
                                
-                       if fluid.type == 'CONTROL':
+                       elif fluid.type == 'CONTROL':
                                split = layout.split()
                                
                                col = split.column()
@@ -148,23 +152,23 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
                                
                                col = split.column()
                                col.itemL(text="Time:")
-                               col=col.column(align=True)
-                               col.itemR(fluid, "start_time", text="Start")
-                               col.itemR(fluid, "end_time", text="End")
+                               sub = col.column(align=True)
+                               sub.itemR(fluid, "start_time", text="Start")
+                               sub.itemR(fluid, "end_time", text="End")
                                
                                split = layout.split()
                                
                                col = split.column()
                                col.itemL(text="Attraction Force:")
-                               col=col.column(align=True)
-                               col.itemR(fluid, "attraction_strength", text="Strength")
-                               col.itemR(fluid, "attraction_radius", text="Radius")
+                               sub = col.column(align=True)
+                               sub.itemR(fluid, "attraction_strength", text="Strength")
+                               sub.itemR(fluid, "attraction_radius", text="Radius")
                                
                                col = split.column()
                                col.itemL(text="Velocity Force:")
-                               col=col.column(align=True)
-                               col.itemR(fluid, "velocity_strength", text="Strength")
-                               col.itemR(fluid, "velocity_radius", text="Radius")
+                               sub = col.column(align=True)
+                               sub.itemR(fluid, "velocity_strength", text="Strength")
+                               sub.itemR(fluid, "velocity_radius", text="Radius")
 
 class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
        __label__ = "Domain World"
@@ -181,6 +185,7 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                fluid = context.fluid.settings
                
                split = layout.split()
@@ -188,26 +193,25 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
                col = split.column()
                col.itemL(text="Gravity:")
                col.itemR(fluid, "gravity", text="")
-               
                col.itemL(text="Real World Size:")
                col.itemR(fluid, "real_world_size", text="Metres")
                
                col = split.column()
                col.itemL(text="Viscosity Presets:")
-               colsub=col.column(align=True)
-               colsub.itemR(fluid, "viscosity_preset", text="")
+               sub = col.column(align=True)
+               sub.itemR(fluid, "viscosity_preset", text="")
                
                if fluid.viscosity_preset == 'MANUAL':
-                       colsub.itemR(fluid, "viscosity_base", text="Base")
-                       colsub.itemR(fluid, "viscosity_exponent", text="Exponent", slider=True)
+                       sub.itemR(fluid, "viscosity_base", text="Base")
+                       sub.itemR(fluid, "viscosity_exponent", text="Exponent", slider=True)
                else:
-                       colsub.itemL(text="")
-                       colsub.itemL(text="")
+                       sub.itemL()
+                       sub.itemL()
                        
                col.itemL(text="Optimization:")
-               col=col.column(align=True)
-               col.itemR(fluid, "grid_levels", slider=True)
-               col.itemR(fluid, "compressibility", slider=True)
+               sub = col.column(align=True)
+               sub.itemR(fluid, "grid_levels", slider=True)
+               sub.itemR(fluid, "compressibility", slider=True)
        
 class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
        __label__ = "Domain Boundary"
@@ -224,20 +228,23 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                fluid = context.fluid.settings
                
                split = layout.split()
+               
                col = split.column()
                col.itemL(text="Slip Type:")
-               col=col.column(align=True)
-               col.itemR(fluid, "slip_type", text="")
+               sub = col.column(align=True)
+               sub.itemR(fluid, "slip_type", text="")
                if fluid.slip_type == 'PARTIALSLIP':
-                       col.itemR(fluid, "partial_slip_amount", slider=True, text="Amount")
+                       sub.itemR(fluid, "partial_slip_amount", slider=True, text="Amount")
+
                col = split.column()
                col.itemL(text="Surface:")
-               col=col.column(align=True)
-               col.itemR(fluid, "surface_smoothing", text="Smoothing")
-               col.itemR(fluid, "surface_subdivisions", text="Subdivisions")   
+               sub = col.column(align=True)
+               sub.itemR(fluid, "surface_smoothing", text="Smoothing")
+               sub.itemR(fluid, "surface_subdivisions", text="Subdivisions")   
                
 class PHYSICS_PT_domain_particles(PhysicButtonsPanel):
        __label__ = "Domain Particles"
@@ -254,9 +261,10 @@ class PHYSICS_PT_domain_particles(PhysicButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                fluid = context.fluid.settings
                
-               col=layout.column(align=True)
+               col = layout.column(align=True)
                col.itemR(fluid, "tracer_particles")
                col.itemR(fluid, "generate_particles")
 
index c73bef18e7328c40adf098e22997acf483251369..80e11f92d6becf2843e1d89668573e0bbc2a521f 100644 (file)
@@ -16,6 +16,7 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                md = context.soft_body
                ob = context.object
 
@@ -50,22 +51,23 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel):
                        col.itemL(text="Simulation:")
                        col.itemR(softbody, "gravity")
                        col.itemR(softbody, "speed")
-                       
-                       
+       
 class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
        __label__ = "Soft Body Goal"
        
        def poll(self, context):
-               return (context.soft_body != None)
+               return (context.soft_body)
                
        def draw_header(self, context):
                layout = self.layout
+               
                softbody = context.soft_body.settings
        
                layout.itemR(softbody, "use_goal", text="")
                
        def draw(self, context):
                layout = self.layout
+               
                md = context.soft_body
                ob = context.object
 
@@ -81,34 +83,35 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
                        col = split.column()
                        col.itemL(text="Goal Strengths:")
                        col.itemR(softbody, "goal_default", text="Default")
-                       subcol = col.column(align=True)
-                       subcol.itemR(softbody, "goal_min", text="Minimum")
-                       subcol.itemR(softbody, "goal_max", text="Maximum")
+                       sub = col.column(align=True)
+                       sub.itemR(softbody, "goal_min", text="Minimum")
+                       sub.itemR(softbody, "goal_max", text="Maximum")
                        
                        col = split.column()
                        col.itemL(text="Goal Settings:")
                        col.itemR(softbody, "goal_spring", text="Stiffness")
                        col.itemR(softbody, "goal_friction", text="Damping")
+                       
                        layout.item_pointerR(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group")
 
 class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
        __label__ = "Soft Body Edges"
        
        def poll(self, context):
-               return (context.soft_body != None)
+               return (context.soft_body)
                
        def draw_header(self, context):
                layout = self.layout
+               
                softbody = context.soft_body.settings
        
                layout.itemR(softbody, "use_edges", text="")
                
        def draw(self, context):
                layout = self.layout
+               
                md = context.soft_body
                ob = context.object
-
-               split = layout.split()
                        
                if md:
                        softbody = md.settings
@@ -128,14 +131,14 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
                        
                        col = split.column()
                        col.itemR(softbody, "stiff_quads")
-                       subcol = col.column()
-                       subcol.active = softbody.stiff_quads
-                       subcol.itemR(softbody, "shear")
+                       sub = col.column()
+                       sub.active = softbody.stiff_quads
+                       sub.itemR(softbody, "shear")
                        
                        col.itemR(softbody, "new_aero", text="Aero")
-                       subcol = col.column()
-                       subcol.enabled = softbody.new_aero
-                       subcol.itemR(softbody, "aero", text="Factor")
+                       sub = col.column()
+                       sub.enabled = softbody.new_aero
+                       sub.itemR(softbody, "aero", text="Factor")
 
                        col.itemL(text="Collision:")
                        col.itemR(softbody, "edge_collision", text="Edge")
@@ -145,25 +148,26 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
        __label__ = "Soft Body Collision"
        
        def poll(self, context):
-               return (context.soft_body != None)
+               return (context.soft_body)
                
        def draw_header(self, context):
                layout = self.layout
+               
                softbody = context.soft_body.settings
        
                layout.itemR(softbody, "self_collision", text="")
                
        def draw(self, context):
                layout = self.layout
+               
                md = context.soft_body
                ob = context.object
-
-               split = layout.split()
                        
                if md:
                        softbody = md.settings
 
                        layout.active = softbody.self_collision
+                       
                        layout.itemL(text="Collision Type:")
                        layout.itemR(softbody, "collision_type", expand=True)
                        
@@ -177,15 +181,14 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel):
        __label__ = "Soft Body Solver"
        
        def poll(self, context):
-               return (context.soft_body != None)
+               return (context.soft_body)
                
        def draw(self, context):
                layout = self.layout
+               
                md = context.soft_body
                ob = context.object
-
-               split = layout.split()
-                       
+               
                if md:
                        softbody = md.settings
 
@@ -200,7 +203,6 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel):
                        
                        col = split.column()
                        col.itemR(softbody, "error_limit")
-
                        col.itemL(text="Helpers:")
                        col.itemR(softbody, "choke")
                        col.itemR(softbody, "fuzzy")
index e952f19796ac19a0b32cb3b8fa327af944ba0ed6..9e0d6c12e17949b27d6e257a28be9257079ba2d2 100644 (file)
@@ -14,8 +14,10 @@ class RenderButtonsPanel(bpy.types.Panel):
 class SCENE_PT_render(RenderButtonsPanel):
        __label__ = "Render"
        COMPAT_ENGINES = set(['BLENDER_RENDER'])
+       
        def draw(self, context):
                layout = self.layout
+               
                rd = context.scene.render_data
 
                row = layout.row()
@@ -31,6 +33,7 @@ class SCENE_PT_layers(RenderButtonsPanel):
        
        def draw(self, context):
                layout = self.layout
+               
                scene = context.scene
                rd = scene.render_data
 
@@ -44,6 +47,7 @@ class SCENE_PT_layers(RenderButtonsPanel):
                rl = rd.layers[rd.active_layer_index]
 
                split = layout.split()
+               
                col = split.column()
                col.itemR(scene, "visible_layers", text="Scene")
                col = split.column()
@@ -54,6 +58,7 @@ class SCENE_PT_layers(RenderButtonsPanel):
                
                layout.itemS()
                layout.itemL(text="Include:")
+               
                split = layout.split()
 
                col = split.column()
@@ -81,6 +86,7 @@ class SCENE_PT_layers(RenderButtonsPanel):
                layout.itemS()
                
                split = layout.split()
+               
                col = split.column()
                col.itemL(text="Passes:")
                col.itemR(rl, "pass_combined")
@@ -117,6 +123,7 @@ class SCENE_PT_shading(RenderButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                rd = context.scene.render_data
                
                split = layout.split()
@@ -139,6 +146,7 @@ class SCENE_PT_performance(RenderButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                rd = context.scene.render_data
 
                split = layout.split()
@@ -146,16 +154,14 @@ class SCENE_PT_performance(RenderButtonsPanel):
                col = split.column(align=True)
                col.itemL(text="Threads:")
                col.row().itemR(rd, "threads_mode", expand=True)
-               colsub = col.column()
-               colsub.enabled = rd.threads_mode == 'THREADS_FIXED'
-               colsub.itemR(rd, "threads")
+               sub = col.column()
+               sub.enabled = rd.threads_mode == 'THREADS_FIXED'
+               sub.itemR(rd, "threads")
 
-               col = split.column()
-               
-               sub = col.column(align=True)
-               sub.itemL(text="Tiles:")
-               sub.itemR(rd, "parts_x", text="X")
-               sub.itemR(rd, "parts_y", text="Y")
+               col = split.column(align=True)
+               col.itemL(text="Tiles:")
+               col.itemR(rd, "parts_x", text="X")
+               col.itemR(rd, "parts_y", text="Y")
 
                split = layout.split()
 
@@ -166,15 +172,14 @@ class SCENE_PT_performance(RenderButtonsPanel):
                row.enabled = not rd.full_sample
 
                col = split.column()
+               col.active = rd.use_compositing
                col.itemL()
                col.itemR(rd, "free_image_textures")
-               col.active = rd.use_compositing
 
                row = layout.row()
                row.active = rd.render_raytracing
                row.itemR(rd, "octree_resolution", text="Ray Tracing Octree")
 
-
 class SCENE_PT_post_processing(RenderButtonsPanel):
        __label__ = "Post Processing"
        __default_closed__ = True
@@ -182,6 +187,7 @@ class SCENE_PT_post_processing(RenderButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                rd = context.scene.render_data
 
                split = layout.split()
@@ -193,12 +199,12 @@ class SCENE_PT_post_processing(RenderButtonsPanel):
                col = split.column()
                row = col.row()
                row.itemR(rd, "fields", text="Fields")
-               rowsub = row.row()
-               rowsub.active = rd.fields
-               rowsub.itemR(rd, "fields_still", text="Still")
-               rowsub = col.row()
-               rowsub.active = rd.fields
-               rowsub.itemR(rd, "field_order", expand=True)
+               sub = row.row()
+               sub.active = rd.fields
+               sub.itemR(rd, "fields_still", text="Still")
+               sub = col.row()
+               sub.active = rd.fields
+               sub.itemR(rd, "field_order", expand=True)
 
                split = layout.split()
                split.itemL()
@@ -210,6 +216,7 @@ class SCENE_PT_output(RenderButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                rd = context.scene.render_data
                
                layout.itemR(rd, "output_path", text="")
@@ -230,6 +237,7 @@ class SCENE_PT_output(RenderButtonsPanel):
                        
                elif rd.file_format == 'OPENEXR':
                        split = layout.split()
+                       
                        col = split.column()
                        col.itemR(rd, "exr_codec")
 
@@ -277,9 +285,11 @@ class SCENE_PT_encoding(RenderButtonsPanel):
 
        def draw(self, context):
                layout = self.layout
+               
                rd = context.scene.render_data
 
                split = layout.split()
+               
                split.itemR(rd, "ffmpeg_format")
                if rd.ffmpeg_format in ('AVI', 'QUICKTIME', 'MKV', 'OGG'):
                        split.itemR(rd, "ffmpeg_codec")
@@ -320,12 +330,14 @@ class SCENE_PT_antialiasing(RenderButtonsPanel):
 
        def draw_header(self, context):
                layout = self.layout
+               
                rd = context.scene.render_data
 
                layout.itemR(rd, "antialiasing", text="")
 
        def draw(self, context):
                layout = self.layout
+               
                rd = context.scene.render_data
 
                layout.active = rd.antialiasing
@@ -385,13 +397,15 @@ class SCENE_PT_stamp(RenderButtonsPanel):
        COMPAT_ENGINES = set(['BLENDER_RENDER'])
 
        def draw_header(self, context):
+               layout = self.layout
+               
                rd = context.scene.render_data
 
-               layout = self.layout
                layout.itemR(rd, "render_stamp", text="")
 
        def draw(self, context):
                layout = self.layout
+               
                rd = context.scene.render_data
 
                layout.active = rd.render_stamp
@@ -408,17 +422,17 @@ class SCENE_PT_stamp(RenderButtonsPanel):
                col.itemR(rd, "stamp_marker", text="Marker")
                col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
 
-               sub = split.column()
-               sub.active = rd.render_stamp
-               sub.itemR(rd, "stamp_foreground", slider=True)
-               sub.itemR(rd, "stamp_background", slider=True)
-               sub.itemR(rd, "stamp_font_size", text="Font Size")
+               col = split.column()
+               col.active = rd.render_stamp
+               col.itemR(rd, "stamp_foreground", slider=True)
+               col.itemR(rd, "stamp_background", slider=True)
+               col.itemR(rd, "stamp_font_size", text="Font Size")
 
                row = layout.split(percentage=0.2)
                row.itemR(rd, "stamp_note", text="Note")
-               rowsub = row.row()
-               rowsub.active = rd.stamp_note
-               rowsub.itemR(rd, "stamp_note_text", text="")
+               sub = row.row()
+               sub.active = rd.stamp_note
+               sub.itemR(rd, "stamp_note_text", text="")
 
 bpy.types.register(SCENE_PT_render)
 bpy.types.register(SCENE_PT_layers)
@@ -430,4 +444,3 @@ bpy.types.register(SCENE_PT_encoding)
 bpy.types.register(SCENE_PT_performance)
 bpy.types.register(SCENE_PT_post_processing)
 bpy.types.register(SCENE_PT_stamp)
-