diff options
author | Thomas Dinges <blender@dingto.org> | 2012-07-29 14:03:46 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2012-07-29 14:03:46 +0400 |
commit | ab38e1d3795f58b5b3e9ca0377c9348ed710471a (patch) | |
tree | e2aa8cd5c7c83fd2781d8a2b3f71d45707dd02a9 /release/scripts | |
parent | b2462f8985c20b364590937d535d8e4d35f97599 (diff) |
User Interface Scripts:
* 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.
Diffstat (limited to 'release/scripts')
20 files changed, 67 insertions, 41 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py index 03aa41bb9aa..29170cde1fa 100644 --- a/release/scripts/startup/bl_ui/properties_data_armature.py +++ b/release/scripts/startup/bl_ui/properties_data_armature.py @@ -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) diff --git a/release/scripts/startup/bl_ui/properties_data_speaker.py b/release/scripts/startup/bl_ui/properties_data_speaker.py index 853c11c96c6..1d7646e9280 100644 --- a/release/scripts/startup/bl_ui/properties_data_speaker.py +++ b/release/scripts/startup/bl_ui/properties_data_speaker.py @@ -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") diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index c25c0c7d40d..54817c27714 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -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): diff --git a/release/scripts/startup/bl_ui/properties_mask_common.py b/release/scripts/startup/bl_ui/properties_mask_common.py index a4a81b01980..699ade3cb95 100644 --- a/release/scripts/startup/bl_ui/properties_mask_common.py +++ b/release/scripts/startup/bl_ui/properties_mask_common.py @@ -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__) diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index 6e66bd0d98b..dfc75168d2b 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -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 diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index 68b261cc1d5..275cb8fab65 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -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") diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py index 4db056e77a2..7f824d94431 100644 --- a/release/scripts/startup/bl_ui/properties_physics_common.py +++ b/release/scripts/startup/bl_ui/properties_physics_common.py @@ -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() diff --git a/release/scripts/startup/bl_ui/properties_physics_field.py b/release/scripts/startup/bl_ui/properties_physics_field.py index 65603c65041..70499b18f41 100644 --- a/release/scripts/startup/bl_ui/properties_physics_field.py +++ b/release/scripts/startup/bl_ui/properties_physics_field.py @@ -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): diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index c9c9c36217b..361332428b6 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -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() diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index 5bde9538e54..96094708ea2 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -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 diff --git a/release/scripts/startup/bl_ui/properties_world.py b/release/scripts/startup/bl_ui/properties_world.py index 76d70aafc2e..5af87875018 100644 --- a/release/scripts/startup/bl_ui/properties_world.py +++ b/release/scripts/startup/bl_ui/properties_world.py @@ -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 diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index 1c86e93a067..53fcf71c31f 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -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': diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index b72e8273e83..87f7104d74e 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -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': diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 40c7b632247..9ff290698d3 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -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 diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index a71a2870bee..fb212f594c8 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -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() diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py index 9c24e48300a..56b242382df 100644 --- a/release/scripts/startup/bl_ui/space_text.py +++ b/release/scripts/startup/bl_ui/space_text.py @@ -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") diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py index 0f573c46d69..ed1d2a0ae24 100644 --- a/release/scripts/startup/bl_ui/space_time.py +++ b/release/scripts/startup/bl_ui/space_time.py @@ -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): diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 03c86ffafaa..5f59a76e724 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -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" diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index a876c607cd3..aea587844cf 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -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() diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index f3365da6ad6..a83a6e215fa 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -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" |