Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2006-12-14 17:53:32 +0300
committerCampbell Barton <ideasman42@gmail.com>2006-12-14 17:53:32 +0300
commitb995593eee050837385ecd6e4e1ef7ac7a6467bf (patch)
treef3ff01add26a7cfc8774856333dbc9f71675c3b1 /release/scripts/mesh_boneweight_copy.py
parent4b99060cc3fc6ef4830df1aa19b49e40bb11c3e5 (diff)
faster sorting syntax in python, try/except for py 2.3 backwards compat
ls.sort(key = lambda v: v.foo) rather then ls.sort(lambda a,b: cmp(a.foo, b.foo))
Diffstat (limited to 'release/scripts/mesh_boneweight_copy.py')
-rwxr-xr-xrelease/scripts/mesh_boneweight_copy.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/release/scripts/mesh_boneweight_copy.py b/release/scripts/mesh_boneweight_copy.py
index 5689daa326f..32caa52f831 100755
--- a/release/scripts/mesh_boneweight_copy.py
+++ b/release/scripts/mesh_boneweight_copy.py
@@ -171,7 +171,9 @@ def worldspace_verts_idx(me, ob):
verts_zsort= [ (i, v.co*mat) for i, v in enumerate(me.verts) ]
# Sorts along the Z Axis so we can optimize the getsnap.
- verts_zsort.sort(lambda a,b: cmp(a[1].z, b[1].z,))
+ try: verts_zsort.sort(key = lambda a: a[1].z)
+ except: verts_zsort.sort(lambda a,b: cmp(a[1].z, b[1].z,))
+
return verts_zsort