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_mirror_tool.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_mirror_tool.py')
-rw-r--r--release/scripts/mesh_mirror_tool.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/release/scripts/mesh_mirror_tool.py b/release/scripts/mesh_mirror_tool.py
index e3273913901..045f37b8333 100644
--- a/release/scripts/mesh_mirror_tool.py
+++ b/release/scripts/mesh_mirror_tool.py
@@ -152,7 +152,8 @@ def mesh_mirror(me, PREF_MIRROR_LOCATION, PREF_XMID_SNAP, PREF_MAX_DIST, PREF_XZ
# Now we have a list of the pairs we might use, lets find the best and do them first.
# de-selecting as we go. so we can makke sure not to mess it up.
- mirror_pairs.sort(lambda a,b: cmp(a[0], b[0]))
+ try: mirror_pairs.sort(key = lambda a: a[0])
+ except: mirror_pairs.sort(lambda a,b: cmp(a[0], b[0]))
for dist, v1,v2 in mirror_pairs: # dist, neg, pos
if v1.sel and v2.sel: