py 2.3 compat for lightwave_import and wizard_curve2tree
This commit is contained in:
@@ -678,7 +678,7 @@ def write_ui(filename):
|
||||
|
||||
Draw.Label('Blender Objects as OBJ:', ui_x+9, ui_y+59, 220, 20)
|
||||
Draw.BeginAlign()
|
||||
EXPORT_BLEN_OBS = Draw.Toggle('Objects', EVENT_REDRAW, ui_x+9, ui_y+40, 60, 20, EXPORT_BLEN_OBS.val, 'Export blender objects as "OBJ objects".', do_split)
|
||||
EXPORT_BLEN_OBS = Draw.Toggle('Objects', EVENT_REDRAW, ui_x+9, ui_y+39, 60, 20, EXPORT_BLEN_OBS.val, 'Export blender objects as "OBJ objects".', do_split)
|
||||
EXPORT_GROUP_BY_OB = Draw.Toggle('Groups', EVENT_REDRAW, ui_x+69, ui_y+39, 60, 20, EXPORT_GROUP_BY_OB.val, 'Export blender objects as "OBJ Groups".', do_split)
|
||||
EXPORT_GROUP_BY_MAT = Draw.Toggle('Material Groups', EVENT_REDRAW, ui_x+129, ui_y+39, 100, 20, EXPORT_GROUP_BY_MAT.val, 'Group by materials.', do_split)
|
||||
Draw.EndAlign()
|
||||
|
||||
@@ -106,6 +106,12 @@ try:
|
||||
except:
|
||||
struct= chunk= cStringIO= None
|
||||
|
||||
# python 2.3 has no reversed() iterator. this will only work on lists and tuples
|
||||
try:
|
||||
reversed
|
||||
except:
|
||||
def reversed(l): return l[::-1]
|
||||
|
||||
### # Debuggin disabled in release.
|
||||
### # do a search replace to enabe debug prints
|
||||
### DEBUG = False
|
||||
|
||||
@@ -266,7 +266,9 @@ class tree:
|
||||
brch.calcData()
|
||||
|
||||
# Sort from big to small, so big branches get priority
|
||||
self.branches_all.sort( key = lambda brch: -brch.bpoints[0].radius )
|
||||
# Py 2.3 dosnt have keywords in sort
|
||||
try: self.branches_all.sort( key = lambda brch: -brch.bpoints[0].radius )
|
||||
except: self.branches_all.sort( lambda brch_a, brch_b: cmp(brch_b.bpoints[0].radius, brch_a.bpoints[0].radius) )
|
||||
|
||||
|
||||
def closestBranchPt(self, co):
|
||||
|
||||
Reference in New Issue
Block a user