Cleanup: pep8, spelling

This commit is contained in:
Campbell Barton
2015-04-22 16:26:00 +10:00
parent 4da050674e
commit e6ceecdf97
19 changed files with 37 additions and 36 deletions

View File

@@ -54,7 +54,7 @@ if bpy.app.build_options.freestyle:
_modules.append("freestyle")
__import__(name=__name__, fromlist=_modules)
_namespace = globals()
_modules_loaded = {name: _namespace[name] for name in _modules if name != 'bpy'}
_modules_loaded = {name: _namespace[name] for name in _modules if name != "bpy"}
del _namespace

View File

@@ -153,40 +153,40 @@ class AddTorus(Operator, object_utils.AddObjectHelper):
col = layout.column(align=True)
col.label(text="Location")
col.prop(self, 'location', text="")
col.prop(self, "location", text="")
col = layout.column(align=True)
col.label(text="Rotation")
col.prop(self, 'rotation', text="")
col.prop(self, "rotation", text="")
col = layout.column(align=True)
col.label(text="Major Segments")
col.prop(self, 'major_segments', text="")
col.prop(self, "major_segments", text="")
col = layout.column(align=True)
col.label(text="Minor Segments")
col.prop(self, 'minor_segments', text="")
col.prop(self, "minor_segments", text="")
col = layout.column(align=True)
col.label(text="Torus Dimensions")
col.row().prop(self, 'mode', expand=True)
col.row().prop(self, "mode", expand=True)
if self.mode == 'MAJOR_MINOR':
col = layout.column(align=True)
col.label(text="Major Radius")
col.prop(self, 'major_radius', text="")
col.prop(self, "major_radius", text="")
col = layout.column(align=True)
col.label(text="Minor Radius")
col.prop(self, 'minor_radius', text="")
col.prop(self, "minor_radius", text="")
else:
col = layout.column(align=True)
col.label(text="Exterior Radius")
col.prop(self, 'abso_major_rad', text="")
col.prop(self, "abso_major_rad", text="")
col = layout.column(align=True)
col.label(text="Interior Radius")
col.prop(self, 'abso_minor_rad', text="")
col.prop(self, "abso_minor_rad", text="")
def invoke(self, context, event):
object_utils.object_add_grid_scale_apply_operator(self, context)

View File

@@ -552,7 +552,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
world.light_settings.sample_method = 'ADAPTIVE_QMC'
world.light_settings.samples = 7
world.light_settings.threshold = 0.005
if hasattr(scene, 'cycles'):
if hasattr(scene, "cycles"):
world.light_settings.ao_factor = 0.05
@staticmethod
@@ -841,7 +841,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
self._offsetNodes(tree)
scene.render.alpha_mode = 'TRANSPARENT'
if hasattr(scene, 'cycles'):
if hasattr(scene, "cycles"):
scene.cycles.film_transparent = True
@staticmethod

View File

@@ -122,7 +122,6 @@ class PlayRenderedAnim(Operator):
if not os.path.exists(file):
self.report({'WARNING'}, "File %r not found" % file)
cmd = [player_path]
# extra options, fps controls etc.
if scene.use_preview_range:

View File

@@ -86,7 +86,7 @@ if bpy.app.build_options.freestyle:
_modules.append("properties_freestyle")
__import__(name=__name__, fromlist=_modules)
_namespace = globals()
_modules_loaded = {name: _namespace[name] for name in _modules if name != 'bpy'}
_modules_loaded = {name: _namespace[name] for name in _modules if name != "bpy"}
del _namespace

View File

@@ -142,12 +142,12 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
@classmethod
def poll(cls, context):
render = context.scene.render
return (super().poll(context) and render.use_multiview \
and render.views_format == 'STEREO_3D')
return (super().poll(context) and render.use_multiview and
render.views_format == 'STEREO_3D')
def draw(self, context):
layout = self.layout
render = context.scene.render
# render = context.scene.render
st = context.camera.stereo
col = layout.column()

View File

@@ -74,8 +74,8 @@ class RenderLayerFreestyleButtonsPanel:
rd = context.scene.render
with_freestyle = bpy.app.build_options.freestyle
return (scene and with_freestyle and rd.use_freestyle
and rd.layers.active and(scene.render.engine in cls.COMPAT_ENGINES))
return (scene and with_freestyle and rd.use_freestyle and
rd.layers.active and(scene.render.engine in cls.COMPAT_ENGINES))
class RenderLayerFreestyleEditorButtonsPanel(RenderLayerFreestyleButtonsPanel):

View File

@@ -542,7 +542,7 @@ class SCENE_PT_game_hysteresis(SceneButtonsPanel, Panel):
row.prop(gs, "scene_hysteresis_percentage", text="")
class WorldButtonsPanel():
class WorldButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "world"

View File

@@ -190,7 +190,7 @@ class MASK_PT_point:
col.prop_search(parent, "parent", tracking,
"objects", icon='OBJECT_DATA', text="Object:")
tracks_list = "tracks" if parent.type == 'POINT_TRACK' else 'plane_tracks'
tracks_list = "tracks" if parent.type == 'POINT_TRACK' else "plane_tracks"
if parent.parent in tracking.objects:
object = tracking.objects[parent.parent]

View File

@@ -274,7 +274,7 @@ class RENDER_PT_performance(RenderButtonsPanel, Panel):
col.prop(rd, "tile_y", text="Y")
col.separator()
col.prop(rd, 'preview_start_resolution')
col.prop(rd, "preview_start_resolution")
col = split.column()
col.label(text="Memory:")

View File

@@ -84,7 +84,7 @@ class FILEBROWSER_HT_header(Header):
class FILEBROWSER_UL_dir(bpy.types.UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
direntry = item
space = context.space_data
# space = context.space_data
icon = 'NONE'
if active_propname == "system_folders_active":
icon = 'DISK_DRIVE'
@@ -99,7 +99,7 @@ class FILEBROWSER_UL_dir(bpy.types.UIList):
row = layout.row(align=True)
row.enabled = direntry.is_valid
# Non-editable entries would show grayed-out, which is bad in this specific case, so switch to mere label.
if direntry.is_property_readonly('name'):
if direntry.is_property_readonly("name"):
row.label(text=direntry.name, icon=icon)
else:
row.prop(direntry, "name", text="", emboss=False, icon=icon)

View File

@@ -281,6 +281,7 @@ class GRAPH_MT_key_transform(Menu):
layout.operator("transform.rotate", text="Rotate")
layout.operator("transform.resize", text="Scale")
class GRAPH_MT_delete(Menu):
bl_label = "Delete"

View File

@@ -54,11 +54,11 @@ class LOGIC_PT_properties(Panel):
row.label("See Text Object")
else:
props = layout.operator("object.game_property_new", text="Add Text Game Property", icon='ZOOMIN')
props.name = 'Text'
props.name = "Text"
props.type = 'STRING'
props = layout.operator("object.game_property_new", text="Add Game Property", icon='ZOOMIN')
props.name = ''
props.name = ""
for i, prop in enumerate(game.properties):
@@ -74,10 +74,10 @@ class LOGIC_PT_properties(Panel):
sub = row.row(align=True)
props = sub.operator("object.game_property_move", text="", icon='TRIA_UP')
props.index = i
props.direction = "UP"
props.direction = 'UP'
props = sub.operator("object.game_property_move", text="", icon='TRIA_DOWN')
props.index = i
props.direction = "DOWN"
props.direction = 'DOWN'
row.operator("object.game_property_remove", text="", icon='X', emboss=False).index = i

View File

@@ -935,7 +935,7 @@ class VIEW3D_MT_angle_control(Menu):
settings = UnifiedPaintPanel.paint_settings(context)
brush = settings.brush
sculpt = (context.sculpt_object != None)
sculpt = (context.sculpt_object is not None)
tex_slot = brush.texture_slot
@@ -3020,7 +3020,6 @@ class VIEW3D_PT_view3d_shading(Panel):
if obj and obj.mode == 'EDIT':
col.prop(view, "show_occlude_wire")
fx_settings = view.fx_settings
sub = col.column()

View File

@@ -2,12 +2,13 @@ bl_info = {
"name": "New Object",
"author": "Your Name Here",
"version": (1, 0),
"blender": (2, 65, 0),
"blender": (2, 75, 0),
"location": "View3D > Add > Mesh > New Object",
"description": "Adds a new Mesh Object",
"warning": "",
"wiki_url": "",
"category": "Add Mesh"}
"category": "Add Mesh",
}
import bpy

View File

@@ -239,7 +239,7 @@ int BLI_convexhull_2d(const float (*points)[2], const int n, int r_points[])
*
* Intended to be used with #BLI_convexhull_2d
*
* \param points Orded hull points
* \param points Ordered hull points
* (result of #BLI_convexhull_2d mapped to a contiguous array).
*
* \note we could return the index of the best edge too if its needed.

View File

@@ -179,7 +179,7 @@ BLI_INLINE eSign signum_enum(float a)
* alternative version of #area_tri_signed_v2
* needed because of float precision issues
*
* \note removes / 2 since its not needed since we only need ths sign.
* \note removes / 2 since its not needed since we only need the sign.
*/
BLI_INLINE float area_tri_signed_v2_alt_2x(const float v1[2], const float v2[2], const float v3[2])
{

View File

@@ -36,6 +36,7 @@ BLACKLIST_DIRS = (
) + tuple(addon_utils.paths()[1:])
BLACKLIST_ADDONS = set()
def _init_addon_blacklist():
# in case we built without cycles