forked from bartvdbraak/blender
Code Cleanup: check is / is not when comparing singletons.
This commit is contained in:
parent
60dc2f521b
commit
e3958015db
@ -206,13 +206,13 @@ class DNACatalogHTML:
|
|||||||
<td>${size}</td>
|
<td>${size}</td>
|
||||||
</tr>"""
|
</tr>"""
|
||||||
|
|
||||||
if field.Type.Structure == None or field.Name.IsPointer():
|
if field.Type.Structure is None or field.Name.IsPointer():
|
||||||
|
|
||||||
# ${reference}
|
# ${reference}
|
||||||
reference = field.Name.AsReference(parentReference)
|
reference = field.Name.AsReference(parentReference)
|
||||||
|
|
||||||
# ${struct}
|
# ${struct}
|
||||||
if parentReference != None:
|
if parentReference is not None:
|
||||||
struct = '<a href="#{0}">{0}</a>'.format(structure.Type.Name)
|
struct = '<a href="#{0}">{0}</a>'.format(structure.Type.Name)
|
||||||
else:
|
else:
|
||||||
struct = structure.Type.Name
|
struct = structure.Type.Name
|
||||||
@ -240,7 +240,7 @@ class DNACatalogHTML:
|
|||||||
|
|
||||||
structure_field = Template(structure_field_template).substitute(d)
|
structure_field = Template(structure_field_template).substitute(d)
|
||||||
|
|
||||||
elif field.Type.Structure != None:
|
elif field.Type.Structure is not None:
|
||||||
reference = field.Name.AsReference(parentReference)
|
reference = field.Name.AsReference(parentReference)
|
||||||
structure_field = self.StructureFields(field.Type.Structure, reference, offset)
|
structure_field = self.StructureFields(field.Type.Structure, reference, offset)
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ class DNAName:
|
|||||||
self.Name = name
|
self.Name = name
|
||||||
|
|
||||||
def AsReference(self, parent):
|
def AsReference(self, parent):
|
||||||
if parent == None:
|
if parent is None:
|
||||||
result = ""
|
result = ""
|
||||||
else:
|
else:
|
||||||
result = parent+"."
|
result = parent+"."
|
||||||
|
@ -93,7 +93,7 @@ class ExportCyclesXML(bpy.types.Operator, ExportHelper):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return context.active_object != None
|
return (context.active_object is not None)
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
filepath = bpy.path.ensure_ext(self.filepath, ".xml")
|
filepath = bpy.path.ensure_ext(self.filepath, ".xml")
|
||||||
|
@ -166,7 +166,7 @@ class DATA_PT_geometry_curve(CurveButtonsPanel, Panel):
|
|||||||
col.prop(curve, "bevel_object", text="")
|
col.prop(curve, "bevel_object", text="")
|
||||||
|
|
||||||
row = col.row()
|
row = col.row()
|
||||||
row.active = curve.bevel_object != None
|
row.active = (curve.bevel_object is not None)
|
||||||
row.prop(curve, "use_fill_caps")
|
row.prop(curve, "use_fill_caps")
|
||||||
|
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ def seek(r, txt, recurs):
|
|||||||
except:
|
except:
|
||||||
keys = None
|
keys = None
|
||||||
|
|
||||||
if keys != None:
|
if keys is not None:
|
||||||
if PRINT_DATA:
|
if PRINT_DATA:
|
||||||
print(txt + '.keys() - ' + str(r.keys()))
|
print(txt + '.keys() - ' + str(r.keys()))
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ def render_gl(context, filepath, shade):
|
|||||||
|
|
||||||
def render_gl_all_modes(context, obj, filepath=""):
|
def render_gl_all_modes(context, obj, filepath=""):
|
||||||
|
|
||||||
assert(obj != None)
|
assert(obj is not None)
|
||||||
assert(filepath != "")
|
assert(filepath != "")
|
||||||
|
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
|
Loading…
Reference in New Issue
Block a user