[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1743] trunk/py/scripts/addons: use identity comparison with None (as suggested by python)
Campbell Barton
ideasman42 at gmail.com
Tue Mar 29 05:54:28 CEST 2011
Revision: 1743
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=1743
Author: campbellbarton
Date: 2011-03-29 03:54:27 +0000 (Tue, 29 Mar 2011)
Log Message:
-----------
use identity comparison with None (as suggested by python)
Modified Paths:
--------------
trunk/py/scripts/addons/io_convert_image_to_mesh_img/import_img.py
trunk/py/scripts/addons/io_import_scene_mhx.py
trunk/py/scripts/addons/io_scene_fbx/__init__.py
trunk/py/scripts/addons/io_scene_x3d/import_x3d.py
trunk/py/scripts/addons/light_field_tools/light_field_tools.py
trunk/py/scripts/addons/object_animrenderbake.py
trunk/py/scripts/addons/rigify/generate.py
trunk/py/scripts/addons/rigify/rigs/biped/arm/fk.py
trunk/py/scripts/addons/rigify/rigs/biped/leg/deform.py
trunk/py/scripts/addons/rigify/rigs/biped/leg/fk.py
trunk/py/scripts/addons/rigify/rigs/biped/leg/ik.py
trunk/py/scripts/addons/rigify/rigs/misc/delta.py
trunk/py/scripts/addons/rigify/rigs/palm.py
trunk/py/scripts/addons/rigify/rigs/spine.py
Modified: trunk/py/scripts/addons/io_convert_image_to_mesh_img/import_img.py
===================================================================
--- trunk/py/scripts/addons/io_convert_image_to_mesh_img/import_img.py 2011-03-29 01:51:46 UTC (rev 1742)
+++ trunk/py/scripts/addons/io_convert_image_to_mesh_img/import_img.py 2011-03-29 03:54:27 UTC (rev 1743)
@@ -102,7 +102,7 @@
# When are we done with this level?
endStr = "END"
- if not currentObjectName == None:
+ if not currentObjectName is None:
endStr = "END_OBJECT = %s" % currentObjectName
line = ""
@@ -408,9 +408,9 @@
# dimensions shrink as we remove pixels
processed_dims = img_props.processed_dims()
- if XSize == None:
+ if XSize is None:
XSize = processed_dims[0]
- if YSize == None:
+ if YSize is None:
YSize = processed_dims[1]
if XSize + XOffset > processed_dims[0]:
Modified: trunk/py/scripts/addons/io_import_scene_mhx.py
===================================================================
--- trunk/py/scripts/addons/io_import_scene_mhx.py 2011-03-29 01:51:46 UTC (rev 1742)
+++ trunk/py/scripts/addons/io_import_scene_mhx.py 2011-03-29 03:54:27 UTC (rev 1743)
@@ -531,7 +531,7 @@
bpyType = typ.capitalize()
print(bpyType, name, data)
loadedData[bpyType][name] = data
- if data == None:
+ if data is None:
return None
for (key, val, sub) in tokens:
@@ -572,7 +572,7 @@
act = ob.animation_data.action
loadedData['Action'][name] = act
- if act == None:
+ if act is None:
print("Ignoring action %s" % name)
return act
act.name = name
@@ -691,7 +691,7 @@
if not eval(args[1]):
return
print("Parse Animation data")
- if rna.animation_data == None:
+ if rna.animation_data is None:
rna.animation_data_create()
adata = rna.animation_data
for (key, val, sub) in tokens:
@@ -813,7 +813,7 @@
global todo
name = args[0]
mat = bpy.data.materials.new(name)
- if mat == None:
+ if mat is None:
return None
loadedData['Material'][name] = mat
for (key, val, sub) in tokens:
@@ -1030,7 +1030,7 @@
for n in range(1,len(val)):
filename += " " + val[n]
img = loadImage(filename)
- if img == None:
+ if img is None:
return None
img.name = imgName
else:
@@ -1070,7 +1070,7 @@
except:
ob = None
- if ob == None:
+ if ob is None:
print("Create", name, data, datName)
ob = createObject(typ, name, data, datName)
print("created", ob)
@@ -1113,7 +1113,7 @@
def linkObject(ob, data):
#print("Data", data, ob.data)
- if data and ob.data == None:
+ if data and ob.data is None:
ob.data = data
print("Data linked", ob, ob.data)
scn = bpy.context.scene
@@ -2174,7 +2174,7 @@
eb = None
tb = ebones[val[1]]
typ = val[2]
- if eb == None:
+ if eb is None:
pass
elif typ == 'Inv':
eb.head = tb.tail
@@ -2309,7 +2309,7 @@
data = None
# print("Old structrna", nvar, data)
- if data == None:
+ if data is None:
try:
creator = args[3]
except:
Modified: trunk/py/scripts/addons/io_scene_fbx/__init__.py
===================================================================
--- trunk/py/scripts/addons/io_scene_fbx/__init__.py 2011-03-29 01:51:46 UTC (rev 1742)
+++ trunk/py/scripts/addons/io_scene_fbx/__init__.py 2011-03-29 03:54:27 UTC (rev 1743)
@@ -113,8 +113,8 @@
keywords = self.as_keywords(ignore=("TX_XROT90", "TX_YROT90", "TX_ZROT90", "TX_SCALE", "check_existing", "filter_glob"))
keywords["GLOBAL_MATRIX"] = GLOBAL_MATRIX
- import io_scene_fbx.export_fbx
- return io_scene_fbx.export_fbx.save(self, context, **keywords)
+ from . import export_fbx
+ return export_fbx.save(self, context, **keywords)
def menu_func(self, context):
Modified: trunk/py/scripts/addons/io_scene_x3d/import_x3d.py
===================================================================
--- trunk/py/scripts/addons/io_scene_x3d/import_x3d.py 2011-03-29 01:51:46 UTC (rev 1742)
+++ trunk/py/scripts/addons/io_scene_x3d/import_x3d.py 2011-03-29 03:54:27 UTC (rev 1743)
@@ -416,7 +416,7 @@
self.PROTO_NAMESPACE = {}
def isRoot(self):
- if self.filename == None:
+ if self.filename is None:
return False
else:
return True
@@ -518,7 +518,7 @@
# where the parent of this object is not the real parent
# - In this case we have added the proto as a child to a node instancing it.
# This is a bit arbitary, but its how Proto's are done with this importer.
- if child.getProtoName() == None and child.getExternprotoName() == None:
+ if child.getProtoName() is None and child.getExternprotoName() is None:
child.getSerialized(results, ancestry)
else:
@@ -624,7 +624,7 @@
self_real = self.getRealNode() # incase we're an instance
f = self_real.getFieldName(field, ancestry)
- if f == None:
+ if f is None:
return default
if ',' in f:
f = f[:f.index(',')] # strip after the comma
@@ -643,7 +643,7 @@
self_real = self.getRealNode() # incase we're an instance
f = self_real.getFieldName(field, ancestry)
- if f == None:
+ if f is None:
return default
if ',' in f:
f = f[:f.index(',')] # strip after the comma
@@ -662,7 +662,7 @@
self_real = self.getRealNode() # incase we're an instance
f = self_real.getFieldName(field, ancestry)
- if f == None:
+ if f is None:
return default
# if ',' in f: f = f[:f.index(',')] # strip after the comma
@@ -689,7 +689,7 @@
self_real = self.getRealNode() # incase we're an instance
f = self_real.getFieldName(field, ancestry)
- if f == None:
+ if f is None:
return default
if ',' in f:
f = f[:f.index(',')] # strip after the comma
@@ -710,7 +710,7 @@
self_real = self.getRealNode() # incase we're an instance
f = self_real.getFieldName(field, ancestry)
- if f == None:
+ if f is None:
return default
if len(f) < 1:
print('\t"%s" wrong length for string conversion for field "%s"' % (f, field))
@@ -763,7 +763,7 @@
if not data_split:
return []
array_data = ' '.join(data_split)
- if array_data == None:
+ if array_data is None:
return []
array_data = array_data.replace(',', ' ')
@@ -1150,7 +1150,7 @@
except:
pass
- if values == None: # dont parse
+ if values is None: # dont parse
values = l_split
# This should not extend over multiple lines however it is possible
@@ -1250,7 +1250,7 @@
else:
print('\tNote, gzip module could not be imported, compressed files will fail to load')
- if data == None:
+ if data is None:
try:
data = open(path, 'rU').read()
except:
@@ -1266,7 +1266,7 @@
'''
data = gzipOpen(path)
- if data == None:
+ if data is None:
return None, 'Failed to open file: ' + path
# Stripped above
@@ -1393,7 +1393,7 @@
# Could add a try/except here, but a console error is more useful.
data = gzipOpen(path)
- if data == None:
+ if data is None:
return None, 'Failed to open file: ' + path
doc = xml.dom.minidom.parseString(data)
@@ -2111,13 +2111,13 @@
if ima:
ima_url = ima.getFieldAsString('url', None, ancestry)
- if ima_url == None:
+ if ima_url is None:
try:
ima_url = ima.getFieldAsStringArray('url', ancestry)[0] # in some cases we get a list of images.
except:
ima_url = None
- if ima_url == None:
+ if ima_url is None:
print("\twarning, image with no URL, this is odd")
else:
bpyima = image_utils.image_load(ima_url, dirName(node.getFilename()), place_holder=False, recursive=False, convert_callback=imageConvertCompat)
@@ -2604,7 +2604,7 @@
# Assign anim curves
node = defDict[key]
- if node.blendObject == None: # Add an object if we need one for animation
+ if node.blendObject is None: # Add an object if we need one for animation
node.blendObject = bpy.data.objects.new('AnimOb', None) # , name)
bpy.context.scene.objects.link(node.blendObject)
Modified: trunk/py/scripts/addons/light_field_tools/light_field_tools.py
===================================================================
--- trunk/py/scripts/addons/light_field_tools/light_field_tools.py 2011-03-29 01:51:46 UTC (rev 1742)
+++ trunk/py/scripts/addons/light_field_tools/light_field_tools.py 2011-03-29 03:54:27 UTC (rev 1743)
@@ -337,7 +337,7 @@
scene.objects.link(nobj)
nobj.select = True
- if scene.objects.active == None or scene.objects.active.mode == 'OBJECT':
+ if scene.objects.active is None or scene.objects.active.mode == 'OBJECT':
scene.objects.active = nobj
Modified: trunk/py/scripts/addons/object_animrenderbake.py
===================================================================
--- trunk/py/scripts/addons/object_animrenderbake.py 2011-03-29 01:51:46 UTC (rev 1742)
+++ trunk/py/scripts/addons/object_animrenderbake.py 2011-03-29 03:54:27 UTC (rev 1743)
@@ -85,7 +85,7 @@
img = uvdata.image
break
- if img == None:
+ if img is None:
self.report({'ERROR'}, "No valid image found to bake to")
return {'CANCELLED'}
Modified: trunk/py/scripts/addons/rigify/generate.py
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list