pep8 edits and change '!= None' to 'is not None'
This commit is contained in:
@@ -426,7 +426,7 @@ def ngon_tesselate(from_data, indices, fix_loops=True):
|
||||
# See if its flipped the wrong way.
|
||||
flip = None
|
||||
for fi in fill:
|
||||
if flip != None:
|
||||
if flip is not None:
|
||||
break
|
||||
for i, vi in enumerate(fi):
|
||||
if vi == 0 and fi[i - 1] == 1:
|
||||
|
||||
@@ -178,7 +178,7 @@ def pointInEdges(pt, edges):
|
||||
intersectCount = 0
|
||||
for ed in edges:
|
||||
xi, yi = lineIntersection2D(x1,y1, x2,y2, ed[0][0], ed[0][1], ed[1][0], ed[1][1])
|
||||
if xi != None: # Is there an intersection.
|
||||
if xi is not None: # Is there an intersection.
|
||||
intersectCount+=1
|
||||
|
||||
return intersectCount % 2
|
||||
@@ -1131,7 +1131,7 @@ class SmartProject(Operator):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.active_object != None
|
||||
return context.active_object is not None
|
||||
|
||||
def execute(self, context):
|
||||
main(context,
|
||||
|
||||
@@ -107,7 +107,7 @@ class DATA_PT_camera(CameraButtonsPanel, Panel):
|
||||
|
||||
col = split.column()
|
||||
|
||||
if cam.dof_object != None:
|
||||
if cam.dof_object is not None:
|
||||
col.enabled = False
|
||||
col.prop(cam, "dof_distance", text="Distance")
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
|
||||
if part:
|
||||
split = layout.split(percentage=0.65)
|
||||
if part.type == 'HAIR':
|
||||
if psys != None and psys.is_edited:
|
||||
if psys is not None and psys.is_edited:
|
||||
split.operator("particle.edited_clear", text="Free Edit")
|
||||
else:
|
||||
row = split.row()
|
||||
@@ -166,12 +166,12 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
|
||||
row = split.row()
|
||||
row.enabled = particle_panel_enabled(context, psys)
|
||||
row.prop(part, "hair_step")
|
||||
if psys != None and psys.is_edited:
|
||||
if psys is not None and psys.is_edited:
|
||||
if psys.is_global_hair:
|
||||
layout.operator("particle.connect_hair")
|
||||
else:
|
||||
layout.operator("particle.disconnect_hair")
|
||||
elif psys != None and part.type == 'REACTOR':
|
||||
elif psys is not None and part.type == 'REACTOR':
|
||||
split.enabled = particle_panel_enabled(context, psys)
|
||||
split.prop(psys, "reactor_target_object")
|
||||
split.prop(psys, "reactor_target_particle_system", text="Particle System")
|
||||
@@ -654,7 +654,7 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel):
|
||||
|
||||
if settings is None:
|
||||
return False
|
||||
if psys != None and psys.point_cache.use_external:
|
||||
if psys is not None and psys.point_cache.use_external:
|
||||
return False
|
||||
return settings.physics_type == 'BOIDS' and engine in cls.COMPAT_ENGINES
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class CONSOLE_MT_console(Menu):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
|
||||
layout.operator("console.clear")
|
||||
layout.operator("console.copy")
|
||||
layout.operator("console.paste")
|
||||
|
||||
@@ -101,7 +101,7 @@ class DOPESHEET_HT_header(Header):
|
||||
row.menu("DOPESHEET_MT_select")
|
||||
row.menu("DOPESHEET_MT_marker")
|
||||
|
||||
if st.mode == 'DOPESHEET' or (st.mode == 'ACTION' and st.action != None):
|
||||
if st.mode == 'DOPESHEET' or (st.mode == 'ACTION' and st.action is not None):
|
||||
row.menu("DOPESHEET_MT_channel")
|
||||
elif st.mode == 'GPENCIL':
|
||||
row.menu("DOPESHEET_MT_gpencil_channel")
|
||||
|
||||
@@ -452,7 +452,7 @@ class IMAGE_PT_game_properties(Panel):
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
|
||||
|
||||
col.prop(ima, "use_animation")
|
||||
sub = col.column(align=True)
|
||||
sub.active = ima.use_animation
|
||||
@@ -507,7 +507,7 @@ class IMAGE_PT_view_waveform(Panel):
|
||||
layout = self.layout
|
||||
|
||||
sima = context.space_data
|
||||
|
||||
|
||||
layout.template_waveform(sima, "scopes")
|
||||
row = layout.split(percentage=0.75)
|
||||
row.prop(sima.scopes, "waveform_alpha")
|
||||
@@ -544,9 +544,9 @@ class IMAGE_PT_sample_line(Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
|
||||
sima = context.space_data
|
||||
|
||||
|
||||
layout.operator("image.sample_line")
|
||||
layout.template_histogram(sima, "sample_histogram")
|
||||
layout.prop(sima.sample_histogram, "mode")
|
||||
@@ -564,9 +564,9 @@ class IMAGE_PT_scope_sample(Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
|
||||
sima = context.space_data
|
||||
|
||||
|
||||
row = layout.row()
|
||||
row.prop(sima.scopes, "use_full_resolution")
|
||||
sub = row.row()
|
||||
@@ -613,14 +613,14 @@ class IMAGE_PT_view_properties(Panel):
|
||||
col = layout.column()
|
||||
col.label("Cursor Location:")
|
||||
col.row().prop(uvedit, "cursor_location", text="")
|
||||
|
||||
|
||||
col.separator()
|
||||
|
||||
|
||||
col.label(text="UVs:")
|
||||
col.row().prop(uvedit, "edge_draw_type", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
|
||||
col = split.column()
|
||||
col.prop(uvedit, "show_faces")
|
||||
col.prop(uvedit, "show_smooth_edges", text="Smooth")
|
||||
|
||||
@@ -194,7 +194,7 @@ class INFO_MT_mesh_add(Menu):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
|
||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||
layout.operator("mesh.primitive_plane_add", icon='MESH_PLANE', text="Plane")
|
||||
layout.operator("mesh.primitive_cube_add", icon='MESH_CUBE', text="Cube")
|
||||
@@ -215,7 +215,7 @@ class INFO_MT_curve_add(Menu):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
|
||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||
layout.operator("curve.primitive_bezier_curve_add", icon='CURVE_BEZCURVE', text="Bezier")
|
||||
layout.operator("curve.primitive_bezier_circle_add", icon='CURVE_BEZCIRCLE', text="Circle")
|
||||
@@ -246,7 +246,7 @@ class INFO_MT_surface_add(Menu):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
|
||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||
layout.operator("surface.primitive_nurbs_surface_curve_add", icon='SURFACE_NCURVE', text="NURBS Curve")
|
||||
layout.operator("surface.primitive_nurbs_surface_circle_add", icon='SURFACE_NCIRCLE', text="NURBS Circle")
|
||||
@@ -262,7 +262,7 @@ class INFO_MT_armature_add(Menu):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
|
||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||
layout.operator("object.armature_add", text="Single Bone", icon='BONE_DATA')
|
||||
|
||||
|
||||
@@ -1049,7 +1049,7 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel):
|
||||
ob = context.active_object
|
||||
|
||||
col = layout.column()
|
||||
col.active = ob.vertex_groups.active != None
|
||||
col.active = ob.vertex_groups.active is not None
|
||||
col.operator("object.vertex_group_normalize_all", text="Normalize All")
|
||||
col.operator("object.vertex_group_normalize", text="Normalize")
|
||||
col.operator("object.vertex_group_invert", text="Invert")
|
||||
|
||||
@@ -47,7 +47,7 @@ class ExportSomeData(bpy.types.Operator, ExportHelper):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.active_object != None
|
||||
return context.active_object is not None
|
||||
|
||||
def execute(self, context):
|
||||
return write_some_data(context, self.filepath, self.use_setting)
|
||||
|
||||
@@ -13,7 +13,7 @@ class SimpleOperator(bpy.types.Operator):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.active_object != None
|
||||
return context.active_object is not None
|
||||
|
||||
def execute(self, context):
|
||||
main(context)
|
||||
|
||||
Reference in New Issue
Block a user