User Interface Scripts:
authorThomas Dinges <blender@dingto.org>
Sun, 29 Jul 2012 10:03:46 +0000 (10:03 +0000)
committerThomas Dinges <blender@dingto.org>
Sun, 29 Jul 2012 10:03:46 +0000 (10:03 +0000)
* Code cleanup, removed unneeded code.
* Style cleanup, don't break lines to early
(unless marked as pep8-80 or pep8-120 compliant)
* Keep 1 line after layout declaration empty.

20 files changed:
release/scripts/startup/bl_ui/properties_data_armature.py
release/scripts/startup/bl_ui/properties_data_speaker.py
release/scripts/startup/bl_ui/properties_game.py
release/scripts/startup/bl_ui/properties_mask_common.py
release/scripts/startup/bl_ui/properties_material.py
release/scripts/startup/bl_ui/properties_object.py
release/scripts/startup/bl_ui/properties_physics_common.py
release/scripts/startup/bl_ui/properties_physics_field.py
release/scripts/startup/bl_ui/properties_scene.py
release/scripts/startup/bl_ui/properties_texture.py
release/scripts/startup/bl_ui/properties_world.py
release/scripts/startup/bl_ui/space_clip.py
release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_node.py
release/scripts/startup/bl_ui/space_sequencer.py
release/scripts/startup/bl_ui/space_text.py
release/scripts/startup/bl_ui/space_time.py
release/scripts/startup/bl_ui/space_userpref.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py

index 03aa41bb9aac2153b187a64d7c993318e173e306..29170cde1fac8a1ef7d6fba25e91eb5f23cd91a6 100644 (file)
@@ -323,6 +323,7 @@ class DATA_PT_onion_skinning(OnionSkinButtonsPanel):  # , Panel): # inherit from
 
     def draw(self, context):
         ob = context.object
+        
         self.draw_settings(context, ob.pose.animation_visualization, bones=True)
 
 
index 853c11c96c6384c29e92d80fc1a6d68eaeb7a744..1d7646e928027f5f19f2b61f0bc46d87db8eb781 100644 (file)
@@ -105,14 +105,13 @@ class DATA_PT_cone(DataButtonsPanel, Panel):
         speaker = context.speaker
 
         split = layout.split()
+        
         col = split.column()
-
         col.label("Angle:")
         col.prop(speaker, "cone_angle_outer", text="Outer")
         col.prop(speaker, "cone_angle_inner", text="Inner")
 
         col = split.column()
-
         col.label("Volume:")
         col.prop(speaker, "cone_volume_outer", text="Outer")
 
index c25c0c7d40df3af7ea4891b17035066fc2de7230..54817c27714ef39ba3e3f59415aca910354c8d05 100644 (file)
@@ -337,7 +337,6 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, Panel):
 
             if dome_type in {'FISHEYE', 'TRUNCATED_REAR', 'TRUNCATED_FRONT'}:
                 col = split.column()
-
                 col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
                 col.prop(gs, "dome_angle", slider=True)
 
@@ -347,14 +346,13 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, Panel):
 
             elif dome_type == 'PANORAM_SPH':
                 col = split.column()
-
                 col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+                
                 col = split.column()
                 col.prop(gs, "dome_tessellation", text="Tessellation")
 
             else:  # cube map
                 col = split.column()
-
                 col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
 
                 col = split.column()
@@ -396,6 +394,7 @@ class RENDER_PT_game_system(RenderButtonsPanel, Panel):
         layout = self.layout
 
         gs = context.scene.game_settings
+        
         row = layout.row()
         row.prop(gs, "use_frame_rate")
         row.prop(gs, "restrict_animation_updates")
@@ -414,11 +413,11 @@ class RENDER_PT_game_display(RenderButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        
+        gs = context.scene.game_settings
 
-        row = layout.row()
-        row.prop(context.scene.render, "fps", text="Animation Frame Rate", slider=False)
+        layout.prop(context.scene.render, "fps", text="Animation Frame Rate", slider=False)
 
-        gs = context.scene.game_settings
         flow = layout.column_flow()
         flow.prop(gs, "show_debug_properties", text="Debug Properties")
         flow.prop(gs, "show_framerate_profile", text="Framerate and Profile")
@@ -582,14 +581,14 @@ class WORLD_PT_game_mist(WorldButtonsPanel, Panel):
         world = context.world
 
         layout.active = world.mist_settings.use_mist
-        row = layout.row()
-        row.prop(world.mist_settings, "falloff")
+        
+        layout.prop(world.mist_settings, "falloff")
 
         row = layout.row(align=True)
         row.prop(world.mist_settings, "start")
         row.prop(world.mist_settings, "depth")
-        row = layout.row()
-        row.prop(world.mist_settings, "intensity", text="Minimum Intensity")
+        
+        layout.prop(world.mist_settings, "intensity", text="Minimum Intensity")
 
 
 class WORLD_PT_game_physics(WorldButtonsPanel, Panel):
index a4a81b01980111d366ca22e839ada9b97cb0ec61..699ade3cb9597e9b831039e75df10c9c1c7e9c73 100644 (file)
@@ -122,9 +122,10 @@ class MASK_PT_spline():
 
         col = layout.column()
         col.prop(spline, "weight_interpolation")
-        rowsub = col.row()
-        rowsub.prop(spline, "use_cyclic")
-        rowsub.prop(spline, "use_fill")
+        
+        row = col.row()
+        row.prop(spline, "use_cyclic")
+        row.prop(spline, "use_fill")
 
 
 class MASK_PT_point():
@@ -309,10 +310,8 @@ class MASK_MT_select(Menu):
 
         layout.separator()
 
-        layout.operator("mask.select_all"
-                        ).action = 'TOGGLE'
-        layout.operator("mask.select_all",
-                        text="Inverse").action = 'INVERT'
+        layout.operator("mask.select_all").action = 'TOGGLE'
+        layout.operator("mask.select_all", text="Inverse").action = 'INVERT'
 
 if __name__ == "__main__":  # only for live edit.
     bpy.utils.register_module(__name__)
index 6e66bd0d98bf2f5e6842be8dbf8c0e6a82afdb21..dfc75168d2b47669399c3718e9934b6caad48c3b 100644 (file)
@@ -350,7 +350,6 @@ class MATERIAL_PT_shading(MaterialButtonsPanel, Panel):
 
 class MATERIAL_PT_transp(MaterialButtonsPanel, Panel):
     bl_label = "Transparency"
-    # bl_options = {'DEFAULT_CLOSED'}
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
index 68b261cc1d544255473cc267f5727b4a27bddf5b..275cb8fab65a0e0de02bd92030db72fe22ddcd90 100644 (file)
@@ -259,7 +259,6 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
             layout.prop(ob, "use_dupli_vertices_rotation", text="Rotation")
 
         elif ob.dupli_type == 'FACES':
-
             row = layout.row()
             row.prop(ob, "use_dupli_faces_scale", text="Scale")
             row.prop(ob, "dupli_faces_scale", text="Inherit Scale")
index 4db056e77a2481e1844513bc67fae3293a0d373b..7f824d94431eaae41767090030b624220e20f2aa 100644 (file)
@@ -186,11 +186,8 @@ def effector_weights_ui(self, context, weights):
 
     split = layout.split()
 
-    col = split.column()
-    col.prop(weights, "gravity", slider=True)
-
-    col = split.column()
-    col.prop(weights, "all", slider=True)
+    split.prop(weights, "gravity", slider=True)
+    split.prop(weights, "all", slider=True)
 
     layout.separator()
 
index 65603c65041d47c1f8d00255ddbd343a3ae2c838..70499b18f41d20389e3dff47d4989c1c8d50d6c8 100644 (file)
@@ -168,7 +168,6 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
 
 class PHYSICS_PT_collision(PhysicButtonsPanel, Panel):
     bl_label = "Collision"
-    #bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
     def poll(cls, context):
index c9c9c36217bc31dc4fb7186ad080f1fe91a948b1..361332428b6ebd61729a6261d39c49de8b4af0e5 100644 (file)
@@ -39,6 +39,7 @@ class SCENE_PT_scene(SceneButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         scene = context.scene
 
         layout.prop(scene, "camera")
@@ -52,6 +53,7 @@ class SCENE_PT_audio(SceneButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         scene = context.scene
         rd = context.scene.render
         ffmpeg = rd.ffmpeg
@@ -81,6 +83,7 @@ class SCENE_PT_unit(SceneButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         unit = context.scene.unit_settings
 
         col = layout.column()
index 5bde9538e5482e04ab672fe26d0721f899449d1a..96094708ea2a46a66f3660378158e46bc7d734d1 100644 (file)
@@ -116,6 +116,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         slot = getattr(context, "texture_slot", None)
         node = getattr(context, "texture_node", None)
         space = context.space_data
index 76d70aafc2e7a6d9a6e70278cafaffe86eeee42e..5af87875018ce154cf1cb44ea706cd3df3561c27 100644 (file)
@@ -82,6 +82,7 @@ class WORLD_PT_world(WorldButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         world = context.world
 
         row = layout.row()
@@ -111,6 +112,7 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         light = context.world.light_settings
 
         layout.active = light.use_ambient_occlusion
@@ -130,6 +132,7 @@ class WORLD_PT_environment_lighting(WorldButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         light = context.world.light_settings
 
         layout.active = light.use_environment_light
@@ -149,6 +152,7 @@ class WORLD_PT_indirect_lighting(WorldButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         light = context.world.light_settings
 
         layout.active = light.use_indirect_light and light.gather_method == 'APPROXIMATE'
@@ -167,6 +171,7 @@ class WORLD_PT_gather(WorldButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         light = context.world.light_settings
 
         layout.active = light.use_ambient_occlusion or light.use_environment_light or light.use_indirect_light
@@ -221,6 +226,7 @@ class WORLD_PT_mist(WorldButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         world = context.world
 
         layout.active = world.mist_settings.use_mist
@@ -250,6 +256,7 @@ class WORLD_PT_stars(WorldButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         world = context.world
 
         layout.active = world.star_settings.use_stars
index 1c86e93a067c3d115bb601b4b92e6dd9c95b65f8..53fcf71c31f6a1097a9d44448183b06917acfdd7 100644 (file)
@@ -187,11 +187,12 @@ class CLIP_PT_tools_marker(CLIP_PT_tracking_panel, Panel):
     bl_label = "Marker"
 
     def draw(self, context):
+        layout = self.layout
+        
         sc = context.space_data
         clip = sc.clip
         settings = clip.tracking.settings
-        layout = self.layout
-
+        
         col = layout.column(align=True)
         col.operator("clip.add_marker_move")
         col.operator("clip.detect_features")
@@ -292,6 +293,7 @@ class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         clip = context.space_data.clip
         tracking = clip.tracking
         settings = tracking.settings
@@ -482,6 +484,7 @@ class CLIP_PT_track(CLIP_PT_tracking_panel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         sc = context.space_data
         clip = context.space_data.clip
         act_track = clip.tracking.tracks.active
@@ -548,6 +551,7 @@ class CLIP_PT_track_settings(CLIP_PT_tracking_panel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         clip = context.space_data.clip
         settings = clip.tracking.settings
 
@@ -782,6 +786,7 @@ class CLIP_PT_proxy(CLIP_PT_clip_view_panel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         sc = context.space_data
         clip = sc.clip
 
@@ -859,6 +864,7 @@ class CLIP_MT_view(Menu):
 
     def draw(self, context):
         layout = self.layout
+        
         sc = context.space_data
 
         if sc.view == 'CLIP':
index b72e8273e831e7ddb44168ddfc7cda595a53c6aa..87f7104d74e7c8b33df1ae368b87df18685132f9 100644 (file)
@@ -213,6 +213,7 @@ class IMAGE_MT_uvs_snap(Menu):
 
     def draw(self, context):
         layout = self.layout
+        
         layout.operator_context = 'EXEC_REGION_WIN'
 
         layout.operator("uv.snap_selected", text="Selected to Pixels").target = 'PIXELS'
@@ -230,6 +231,7 @@ class IMAGE_MT_uvs_mirror(Menu):
 
     def draw(self, context):
         layout = self.layout
+        
         layout.operator_context = 'EXEC_REGION_WIN'
 
         layout.operator("transform.mirror", text="X Axis").constraint_axis[0] = True
@@ -837,16 +839,10 @@ class IMAGE_UV_sculpt(Panel, ImagePaintPanel):
             row = col.row(align=True)
             self.prop_unified_strength(row, context, brush, "strength", slider=True, text="Strength")
             self.prop_unified_strength(row, context, brush, "use_pressure_strength")
-
-        split = layout.split()
-        col = split.column()
-
+        col = layout.column()
         col.prop(toolsettings, "uv_sculpt_lock_borders")
         col.prop(toolsettings, "uv_sculpt_all_islands")
-
-        split = layout.split()
-        col = split.column()
-
         col.prop(toolsettings, "uv_sculpt_tool")
 
         if toolsettings.uv_sculpt_tool == 'RELAX':
index 40c7b63224772c79c46e4f44c8f665e92465ecf0..9ff290698d3219171768c678321c4e646a571238 100644 (file)
@@ -226,6 +226,7 @@ class NODE_PT_quality(bpy.types.Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         snode = context.space_data
         tree = snode.node_tree
 
index a71a2870beed2b207a41ff83dd6fb7e08ae931a4..fb212f594c8aaa300aba8631703112b2e6e9c101 100644 (file)
@@ -184,6 +184,7 @@ class SEQUENCER_MT_add(Menu):
 
     def draw(self, context):
         layout = self.layout
+        
         layout.operator_context = 'INVOKE_REGION_WIN'
 
         if len(bpy.data.scenes) > 10:
@@ -216,6 +217,7 @@ class SEQUENCER_MT_add_effect(Menu):
 
     def draw(self, context):
         layout = self.layout
+        
         layout.operator_context = 'INVOKE_REGION_WIN'
 
         layout.operator("sequencer.effect_strip_add", text="Add").type = 'ADD'
@@ -834,6 +836,7 @@ class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         render = context.scene.render
 
         col = layout.column()
index 9c24e48300af3dd35e4c70fa745691b70983556e..56b242382dfbabeea713d211924c20e74ce5bfb0 100644 (file)
@@ -302,6 +302,7 @@ class TEXT_MT_toolbox(Menu):
 
     def draw(self, context):
         layout = self.layout
+        
         layout.operator_context = 'INVOKE_DEFAULT'
 
         layout.operator("text.cut")
index 0f573c46d698283fef041526945a19eab043bfd6..ed1d2a0ae24ff9783b54c330ae79fc49cab71c71 100644 (file)
@@ -160,8 +160,7 @@ class TIME_MT_frame(Menu):
 
         layout.separator()
 
-        sub = layout.row()
-        sub.menu("TIME_MT_autokey")
+        layout.menu("TIME_MT_autokey")
 
 
 class TIME_MT_playback(Menu):
index 03c86ffafaa013fa6e403d7f87126b52f5c2537d..5f59a76e724ce34f87e68634c143606a4d62e761 100644 (file)
@@ -79,6 +79,7 @@ class USERPREF_HT_header(Header):
 
     def draw(self, context):
         layout = self.layout
+        
         layout.template_header(menus=False)
 
         userpref = context.user_preferences
@@ -137,6 +138,7 @@ class USERPREF_MT_splash(Menu):
 
     def draw(self, context):
         layout = self.layout
+        
         split = layout.split()
         row = split.row()
         row.label("")
@@ -850,6 +852,7 @@ class USERPREF_MT_ndof_settings(Menu):
 
     def draw(self, context):
         layout = self.layout
+        
         input_prefs = context.user_preferences.inputs
 
         layout.separator()
@@ -979,6 +982,7 @@ class USERPREF_MT_addons_dev_guides(Menu):
     # menu to open web-pages with addons development guides
     def draw(self, context):
         layout = self.layout
+        
         layout.operator("wm.url_open", text="API Concepts", icon='URL').url = "http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro"
         layout.operator("wm.url_open", text="Addon Guidelines", icon='URL').url = "http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons"
         layout.operator("wm.url_open", text="How to share your addon", icon='URL').url = "http://wiki.blender.org/index.php/Dev:Py/Sharing"
index a876c607cd370101bbaa6d4afa7324bda435fbaf..aea587844cfafcae076b48447114e6bafa783b12 100644 (file)
@@ -176,11 +176,12 @@ class VIEW3D_MT_transform(VIEW3D_MT_transform_base):
 # Object-specific extensions to Transform menu
 class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base):
     def draw(self, context):
+        layout = self.layout
+        
         # base menu
         VIEW3D_MT_transform_base.draw(self, context)
 
         # object-specific option follow...
-        layout = self.layout
         layout.separator()
 
         layout.operator("transform.translate", text="Move Texture Space").texture_space = True
@@ -212,11 +213,12 @@ class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base):
 # Armature EditMode extensions to Transform menu
 class VIEW3D_MT_transform_armature(VIEW3D_MT_transform_base):
     def draw(self, context):
+        layout = self.layout
+        
         # base menu
         VIEW3D_MT_transform_base.draw(self, context)
 
         # armature specific extensions follow...
-        layout = self.layout
         layout.separator()
 
         obj = context.object
@@ -429,18 +431,23 @@ class VIEW3D_MT_view_align_selected(Menu):
         props = layout.operator("view3d.viewnumpad", text="Top")
         props.align_active = True
         props.type = 'TOP'
+        
         props = layout.operator("view3d.viewnumpad", text="Bottom")
         props.align_active = True
         props.type = 'BOTTOM'
+        
         props = layout.operator("view3d.viewnumpad", text="Front")
         props.align_active = True
         props.type = 'FRONT'
+        
         props = layout.operator("view3d.viewnumpad", text="Back")
         props.align_active = True
         props.type = 'BACK'
+        
         props = layout.operator("view3d.viewnumpad", text="Right")
         props.align_active = True
         props.type = 'RIGHT'
+        
         props = layout.operator("view3d.viewnumpad", text="Left")
         props.align_active = True
         props.type = 'LEFT'
@@ -1191,6 +1198,7 @@ class VIEW3D_MT_vertex_group(Menu):
 
     def draw(self, context):
         layout = self.layout
+        
         layout.operator_context = 'EXEC_AREA'
         layout.operator("object.vertex_group_assign", text="Assign to New Group").new = True
 
@@ -1349,6 +1357,7 @@ class VIEW3D_MT_particle_specials(Menu):
 
     def draw(self, context):
         layout = self.layout
+        
         particle_edit = context.tool_settings.particle_edit
 
         layout.operator("particle.rekey")
@@ -1792,6 +1801,7 @@ class VIEW3D_MT_edit_mesh_edges(Menu):
 
     def draw(self, context):
         layout = self.layout
+        
         layout.operator_context = 'INVOKE_REGION_WIN'
 
         layout.operator("mesh.edge_face_add")
@@ -1839,6 +1849,7 @@ class VIEW3D_MT_edit_mesh_faces(Menu):
 
     def draw(self, context):
         layout = self.layout
+        
         layout.operator_context = 'INVOKE_REGION_WIN'
 
         layout.operator("mesh.flip_normals")
@@ -2632,6 +2643,7 @@ class VIEW3D_PT_etch_a_ton(Panel):
 
     def draw(self, context):
         layout = self.layout
+        
         toolsettings = context.scene.tool_settings
 
         col = layout.column()
index f3365da6ad63c2a789e3a1caad74f618c7f8fb45..a83a6e215faad09566d5332cdb66cec9d5bcfb68 100644 (file)
@@ -1124,6 +1124,7 @@ class VIEW3D_MT_tools_projectpaint_clone(Menu):
 
     def draw(self, context):
         layout = self.layout
+        
         for i, tex in enumerate(context.active_object.data.uv_textures):
             props = layout.operator("wm.context_set_int", text=tex.name)
             props.data_path = "active_object.data.uv_texture_clone_index"