diff options
author | Campbell Barton <ideasman42@gmail.com> | 2006-11-16 00:12:53 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2006-11-16 00:12:53 +0300 |
commit | a84f60a3bded552640c84169398f3aaeb5f58fcb (patch) | |
tree | c33c6bca50aa7e1f686146c651a4c3b1c562cb89 | |
parent | 6cd62026b9503d1d2153af573b72eeb115d5d9be (diff) |
fixed error that was caused by 2 vertex loops center being 0.0 distance apart, also made the python 2.3 syntax default.
-rw-r--r-- | release/scripts/mesh_skin.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/release/scripts/mesh_skin.py b/release/scripts/mesh_skin.py index 5d3bb0d1ae7..2f170df730a 100644 --- a/release/scripts/mesh_skin.py +++ b/release/scripts/mesh_skin.py @@ -76,7 +76,7 @@ class edge: self.removed = 0 # Have we been culled from the eloop self.match = None # The other edge were making a face with - self.cent= (co1+co2)*0.5 + self.cent= Mathutils.MidpointVecs(co1, co2) self.angle= 0.0 class edgeLoop: @@ -248,10 +248,13 @@ def getSelectedEdges(me, ob): return i1, i2 # value is [edge, face_sel_user_in] + ''' try: # Python 2.4 only edge_dict= dict((ed_key(ed), [ed, 0]) for ed in me.edges) except: - edge_dict= dict([(ed_key(ed), [ed, 0]) for ed in me.edges]) + ''' + # Cant try 2.4 syntax because python 2.3 will complain still + edge_dict= dict([(ed_key(ed), [ed, 0]) for ed in me.edges]) for f in me.faces: if f.sel: @@ -374,7 +377,7 @@ def skin2EdgeLoops(eloop1, eloop2, me, ob, MODE): ed_dir= e1.cent-e2.cent a_diff= AngleBetweenVecs(DIR, ed_dir)/18 # 0 t0 18 - totEloopDist += (diff * (1+a_diff)) / loopDist + totEloopDist += (diff * (1+a_diff)) / (1+loopDist) # Premeture break if where no better off if totEloopDist > bestEloopDist: |