diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-08 05:32:34 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-08 05:32:34 +0400 |
commit | f086201518b85f6dd2ae60ae37dc14f1d1406c01 (patch) | |
tree | d2b4a030367688f28324dd9a8ddfa7c5591d9582 /release/scripts/startup | |
parent | 95948d0e0e1e3308b8449486f676ca1663afe124 (diff) |
cmake & pep8 tidy up, also some style edits.
remove unneeded collection length function.
Diffstat (limited to 'release/scripts/startup')
17 files changed, 72 insertions, 66 deletions
diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py index d085b7ea105..55592621112 100644 --- a/release/scripts/startup/bl_operators/clip.py +++ b/release/scripts/startup/bl_operators/clip.py @@ -155,7 +155,8 @@ class CLIP_OT_delete_proxy(Operator): self._rmproxy(d + '_undistorted') self._rmproxy(os.path.join(absproxy, 'proxy_' + str(x) + '.avi')) - tc = ('free_run.blen_tc', 'interp_free_run.blen_tc', \ + tc = ('free_run.blen_tc', + 'interp_free_run.blen_tc', 'record_run.blen_tc') for x in tc: @@ -280,10 +281,10 @@ class CLIP_OT_constraint_to_fcurve(Operator): efra = max(efra, track.markers[-1].frame) if sfra is None or efra is None: - return + return # Store object matrices - for x in range(sfra, efra+1): + for x in range(sfra, efra + 1): scene.frame_set(x) matrices.append(ob.matrix_world.copy()) @@ -291,7 +292,7 @@ class CLIP_OT_constraint_to_fcurve(Operator): # Apply matrices on object and insert keyframes i = 0 - for x in range(sfra, efra+1): + for x in range(sfra, efra + 1): scene.frame_set(x) ob.matrix_world = matrices[i] diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py index 490ee230220..a062ac6f4c5 100644 --- a/release/scripts/startup/bl_operators/object_quick_effects.py +++ b/release/scripts/startup/bl_operators/object_quick_effects.py @@ -105,8 +105,7 @@ class QuickFur(Operator): psys.settings.child_type = 'INTERPOLATED' obj.data.materials.append(mat) - obj.particle_systems[-1].settings.material = \ - len(obj.data.materials) + psys.settings.material = len(obj.data.materials) return {'FINISHED'} diff --git a/release/scripts/startup/bl_operators/uvcalc_smart_project.py b/release/scripts/startup/bl_operators/uvcalc_smart_project.py index 66d0d72efc1..17e353ff238 100644 --- a/release/scripts/startup/bl_operators/uvcalc_smart_project.py +++ b/release/scripts/startup/bl_operators/uvcalc_smart_project.py @@ -212,8 +212,11 @@ def islandIntersectUvIsland(source, target, SourceOffset): # Edge intersect test for ed in edgeLoopsSource: for seg in edgeLoopsTarget: - i = geometry.intersect_line_line_2d(\ - seg[0], seg[1], SourceOffset+ed[0], SourceOffset+ed[1]) + i = geometry.intersect_line_line_2d(seg[0], + seg[1], + SourceOffset+ed[0], + SourceOffset+ed[1], + ) if i: return 1 # LINE INTERSECTION @@ -773,15 +776,16 @@ def main_consts(): global ROTMAT_2D_POS_45D global RotMatStepRotation - ROTMAT_2D_POS_90D = Matrix.Rotation( radians(90.0), 2) - ROTMAT_2D_POS_45D = Matrix.Rotation( radians(45.0), 2) + ROTMAT_2D_POS_90D = Matrix.Rotation(radians(90.0), 2) + ROTMAT_2D_POS_45D = Matrix.Rotation(radians(45.0), 2) RotMatStepRotation = [] rot_angle = 22.5 #45.0/2 while rot_angle > 0.1: - RotMatStepRotation.append([\ - Matrix.Rotation( radians(rot_angle), 2),\ - Matrix.Rotation( radians(-rot_angle), 2)]) + RotMatStepRotation.append([ + Matrix.Rotation(radians(+rot_angle), 2), + Matrix.Rotation(radians(-rot_angle), 2), + ]) rot_angle = rot_angle/2.0 diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py index 0abbf281754..1a0fb0ef4ac 100644 --- a/release/scripts/startup/bl_ui/properties_data_camera.py +++ b/release/scripts/startup/bl_ui/properties_data_camera.py @@ -108,6 +108,7 @@ class DATA_PT_lens(CameraButtonsPanel, Panel): col.prop(cam, "clip_start", text="Start") col.prop(cam, "clip_end", text="End") + class DATA_PT_camera(CameraButtonsPanel, Panel): bl_label = "Camera" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} @@ -120,8 +121,8 @@ class DATA_PT_camera(CameraButtonsPanel, Panel): row = layout.row(align=True) row.menu("CAMERA_MT_presets", text=bpy.types.CAMERA_MT_presets.bl_label) - row.operator("camera.preset_add", text="", icon="ZOOMIN") - row.operator("camera.preset_add", text="", icon="ZOOMOUT").remove_active = True + row.operator("camera.preset_add", text="", icon='ZOOMIN') + row.operator("camera.preset_add", text="", icon='ZOOMOUT').remove_active = True layout.label(text="Sensor:") @@ -137,6 +138,7 @@ class DATA_PT_camera(CameraButtonsPanel, Panel): col = split.column(align=True) col.prop(cam, "sensor_fit", text="") + class DATA_PT_camera_dof(CameraButtonsPanel, Panel): bl_label = "Depth of Field" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} @@ -156,6 +158,7 @@ class DATA_PT_camera_dof(CameraButtonsPanel, Panel): col.active = cam.dof_object is None col.prop(cam, "dof_distance", text="Distance") + class DATA_PT_camera_display(CameraButtonsPanel, Panel): bl_label = "Display" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} diff --git a/release/scripts/startup/bl_ui/properties_data_lamp.py b/release/scripts/startup/bl_ui/properties_data_lamp.py index 4ff180f74fb..974924be46c 100644 --- a/release/scripts/startup/bl_ui/properties_data_lamp.py +++ b/release/scripts/startup/bl_ui/properties_data_lamp.py @@ -134,8 +134,8 @@ class DATA_PT_sunsky(DataButtonsPanel, Panel): row = layout.row(align=True) row.prop(lamp, "use_sky") row.menu("LAMP_MT_sunsky_presets", text=bpy.types.LAMP_MT_sunsky_presets.bl_label) - row.operator("lamp.sunsky_preset_add", text="", icon="ZOOMIN") - row.operator("lamp.sunsky_preset_add", text="", icon="ZOOMOUT").remove_active = True + row.operator("lamp.sunsky_preset_add", text="", icon='ZOOMIN') + row.operator("lamp.sunsky_preset_add", text="", icon='ZOOMOUT').remove_active = True row = layout.row() row.active = lamp.use_sky or lamp.use_atmosphere diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index 0d104571e4b..ba9bb4a624d 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -315,11 +315,9 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, Panel): split = layout.split() - if dome_type == 'FISHEYE' or \ - dome_type == 'TRUNCATED_REAR' or \ - dome_type == 'TRUNCATED_FRONT': - + 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) @@ -336,6 +334,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, Panel): else: # cube map col = split.column() + col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True) col = split.column() diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index 62cb735fda9..f5a95016baa 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -124,7 +124,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel, Panel): split.template_ID(ob, "active_material", new="material.new") row = split.row() if mat: - row.prop(mat, "use_nodes", icon="NODETREE", text="") + row.prop(mat, "use_nodes", icon='NODETREE', text="") if slot: row.prop(slot, "link", text="") @@ -501,8 +501,8 @@ class MATERIAL_PT_sss(MaterialButtonsPanel, Panel): row = layout.row().split() sub = row.row(align=True).split(percentage=0.75) sub.menu("MATERIAL_MT_sss_presets", text=bpy.types.MATERIAL_MT_sss_presets.bl_label) - sub.operator("material.sss_preset_add", text="", icon="ZOOMIN") - sub.operator("material.sss_preset_add", text="", icon="ZOOMOUT").remove_active = True + sub.operator("material.sss_preset_add", text="", icon='ZOOMIN') + sub.operator("material.sss_preset_add", text="", icon='ZOOMOUT').remove_active = True split = layout.split() diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index a359d58b59e..36b8129ad8a 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -267,12 +267,12 @@ class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel): ob = context.object split = layout.split() - + col = split.column() col.label(text="Tracking Axes:") col.prop(ob, "track_axis", text="Axis") col.prop(ob, "up_axis", text="Up Axis") - + col = split.column() col.prop(ob, "use_slow_parent") row = col.row() diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py index c66a0563754..afb3c000980 100644 --- a/release/scripts/startup/bl_ui/properties_physics_cloth.py +++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py @@ -73,8 +73,8 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel): col.label(text="Presets:") sub = col.row(align=True) sub.menu("CLOTH_MT_presets", text=bpy.types.CLOTH_MT_presets.bl_label) - sub.operator("cloth.preset_add", text="", icon="ZOOMIN") - sub.operator("cloth.preset_add", text="", icon="ZOOMOUT").remove_active = True + sub.operator("cloth.preset_add", text="", icon='ZOOMIN') + sub.operator("cloth.preset_add", text="", icon='ZOOMOUT').remove_active = True col.label(text="Quality:") col.prop(cloth, "quality", text="Steps", slider=True) diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py index efb760c0b43..ce65350e69b 100644 --- a/release/scripts/startup/bl_ui/properties_physics_fluid.py +++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py @@ -206,7 +206,7 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel): col = split.column() if scene.use_gravity: - col.label(text="Use Scene Gravity", icon="SCENE_DATA") + col.label(text="Use Scene Gravity", icon='SCENE_DATA') sub = col.column() sub.enabled = False sub.prop(fluid, "gravity", text="") @@ -215,7 +215,7 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel): col.prop(fluid, "gravity", text="") if scene.unit_settings.system != 'NONE': - col.label(text="Use Scene Size Units", icon="SCENE_DATA") + col.label(text="Use Scene Size Units", icon='SCENE_DATA') sub = col.column() sub.enabled = False sub.prop(fluid, "simulation_scale", text="Metres") diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index 815f0a77570..145ae292e11 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -186,8 +186,8 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel): row = layout.row(align=True) row.menu("RENDER_MT_presets", text=bpy.types.RENDER_MT_presets.bl_label) - row.operator("render.preset_add", text="", icon="ZOOMIN") - row.operator("render.preset_add", text="", icon="ZOOMOUT").remove_active = True + row.operator("render.preset_add", text="", icon='ZOOMIN') + row.operator("render.preset_add", text="", icon='ZOOMOUT').remove_active = True split = layout.split() diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index 09209017823..3148c0dd51a 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -312,10 +312,10 @@ class CLIP_PT_track(Panel): row = layout.row(align=True) label = bpy.types.CLIP_MT_track_color_presets.bl_label row.menu('CLIP_MT_track_color_presets', text=label) - row.menu('CLIP_MT_track_color_specials', text="", icon="DOWNARROW_HLT") - row.operator("clip.track_color_preset_add", text="", icon="ZOOMIN") + row.menu('CLIP_MT_track_color_specials', text="", icon='DOWNARROW_HLT') + row.operator("clip.track_color_preset_add", text="", icon='ZOOMIN') props = row.operator("clip.track_color_preset_add", - text="", icon="ZOOMOUT") + text="", icon='ZOOMOUT') props.remove_active = True row = layout.row() @@ -349,8 +349,8 @@ class CLIP_PT_tracking_camera(Panel): row = layout.row(align=True) label = bpy.types.CLIP_MT_camera_presets.bl_label row.menu('CLIP_MT_camera_presets', text=label) - row.operator("clip.camera_preset_add", text="", icon="ZOOMIN") - props = row.operator("clip.camera_preset_add", text="", icon="ZOOMOUT") + row.operator("clip.camera_preset_add", text="", icon='ZOOMIN') + props = row.operator("clip.camera_preset_add", text="", icon='ZOOMOUT') props.remove_active = True row = layout.row(align=True) @@ -441,11 +441,11 @@ class CLIP_PT_track_settings(Panel): active = clip.tracking.tracks.active if active: - layout.prop(active, "tracker") - if active.tracker == "KLT": - layout.prop(active, "pyramid_levels") - if active.tracker == "SAD": - layout.prop(active, "correlation_min") + layout.prop(active, "tracker") + if active.tracker == 'KLT': + layout.prop(active, "pyramid_levels") + elif active.tracker == 'SAD': + layout.prop(active, "correlation_min") layout.prop(settings, "frames_adjust") layout.prop(settings, "speed") @@ -489,7 +489,7 @@ class CLIP_PT_stabilization(Panel): sub.operator("clip.stabilize_2d_remove", icon='ZOOMOUT', text="") sub.menu('CLIP_MT_stabilize_2d_specials', text="", - icon="DOWNARROW_HLT") + icon='DOWNARROW_HLT') layout.prop(stab, "influence_location") diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 50db989a2e2..170ba3ccd0e 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -61,7 +61,7 @@ class IMAGE_MT_view(Menu): layout.separator() - ratios = [[1, 8], [1, 4], [1, 2], [1, 1], [2, 1], [4, 1], [8, 1]] + ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1)) for a, b in ratios: layout.operator("image.view_zoom_ratio", text="Zoom" + " %d:%d" % (a, b)).ratio = a / b @@ -746,12 +746,12 @@ class IMAGE_PT_paint_curve(BrushButtonsPanel, Panel): layout.template_curve_mapping(brush, "curve") row = layout.row(align=True) - row.operator("brush.curve_preset", icon="SMOOTHCURVE", text="").shape = 'SMOOTH' - row.operator("brush.curve_preset", icon="SPHERECURVE", text="").shape = 'ROUND' - row.operator("brush.curve_preset", icon="ROOTCURVE", text="").shape = 'ROOT' - row.operator("brush.curve_preset", icon="SHARPCURVE", text="").shape = 'SHARP' - row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LINE' - row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX' + row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH' + row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND' + row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT' + row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP' + row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE' + row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX' if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index c6c4a8f3335..a2ede26ecc6 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -967,10 +967,10 @@ class USERPREF_PT_addons(Panel): continue # check if addon should be visible with current filters - if (filter == "All") or \ - (filter == info["category"]) or \ - (filter == "Enabled" and is_enabled) or \ - (filter == "Disabled" and not is_enabled): + if ((filter == "All") or + (filter == info["category"]) or + (filter == "Enabled" and is_enabled) or + (filter == "Disabled" and not is_enabled)): if search and search not in info["name"].lower(): if info["author"]: diff --git a/release/scripts/startup/bl_ui/space_userpref_keymap.py b/release/scripts/startup/bl_ui/space_userpref_keymap.py index 5e5ce462da9..d738e806320 100644 --- a/release/scripts/startup/bl_ui/space_userpref_keymap.py +++ b/release/scripts/startup/bl_ui/space_userpref_keymap.py @@ -223,7 +223,7 @@ class InputKeyMapPanel: col = layout.column() row = col.row() - row.label(text=km.name, icon="DOT") + row.label(text=km.name, icon='DOT') row.label() row.label() @@ -265,13 +265,13 @@ class InputKeyMapPanel: if not text: text = "Blender (default)" row.menu("USERPREF_MT_keyconfigs", text=text) - row.operator("wm.keyconfig_preset_add", text="", icon="ZOOMIN") - row.operator("wm.keyconfig_preset_add", text="", icon="ZOOMOUT").remove_active = True + row.operator("wm.keyconfig_preset_add", text="", icon='ZOOMIN') + row.operator("wm.keyconfig_preset_add", text="", icon='ZOOMOUT').remove_active = True #~ layout.context_pointer_set("keyconfig", wm.keyconfigs.active) #~ row.operator("wm.keyconfig_remove", text="", icon='X') - row.prop(context.space_data, "filter_text", icon="VIEWZOOM") + row.prop(context.space_data, "filter_text", icon='VIEWZOOM') col.separator() diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 9edb1ea1197..2d3be2015d7 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -1536,7 +1536,7 @@ class VIEW3D_MT_edit_mesh_select_mode(Menu): class VIEW3D_MT_edit_mesh_extrude(Menu): bl_label = "Extrude" - _extrude_funcs = { \ + _extrude_funcs = { "VERT": lambda layout: layout.operator("mesh.extrude_vertices_move", text="Vertices Only"), "EDGE": lambda layout: layout.operator("mesh.extrude_edges_move", text="Edges Only"), "FACE": lambda layout: layout.operator("mesh.extrude_faces_move", text="Individual Faces"), diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 332577a7902..5bcdbc1efe8 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -172,7 +172,7 @@ class VIEW3D_PT_tools_meshedit(View3DPanel, Panel): class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel): bl_context = "mesh_edit" bl_label = "Mesh Options" - + @classmethod def poll(cls, context): return context.active_object @@ -912,12 +912,12 @@ class VIEW3D_PT_tools_brush_curve(PaintPanel, Panel): layout.template_curve_mapping(brush, "curve", brush=True) row = layout.row(align=True) - row.operator("brush.curve_preset", icon="SMOOTHCURVE", text="").shape = 'SMOOTH' - row.operator("brush.curve_preset", icon="SPHERECURVE", text="").shape = 'ROUND' - row.operator("brush.curve_preset", icon="ROOTCURVE", text="").shape = 'ROOT' - row.operator("brush.curve_preset", icon="SHARPCURVE", text="").shape = 'SHARP' - row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LINE' - row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX' + row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH' + row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND' + row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT' + row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP' + row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE' + row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX' class VIEW3D_PT_sculpt_options(PaintPanel, Panel): |