Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
# * View frustum clipping
# * Scene clipping done using bounding box instead of object center
# * Fix camera type selection for blender>2.43 (Thanks to Thomas Lachmann)
# * View frustum clipping
# * Scene clipping done using bounding box instead of object center
# * Fix camera type selection for blender>2.43 (Thanks to Thomas Lachmann)
+# * Compatibility with python 2.3
#
# ---------------------------------------------------------------------
#
# ---------------------------------------------------------------------
from math import *
import sys, time
from math import *
import sys, time
+def uniq(alist):
+ tmpdict = dict()
+ return [tmpdict.setdefault(e,e) for e in alist if e not in tmpdict]
+ # in python > 2.4 we ca use the following
+ #return [ u for u in alist if u not in locals()['_[1]'] ]
+
+
polygons = dict()
polygons['SHOW'] = True
polygons['SHADING'] = 'FLAT' # FLAT or TOON
polygons = dict()
polygons['SHOW'] = True
polygons['SHADING'] = 'FLAT' # FLAT or TOON
- polygons['HSR'] = 'NEWELL' # PAINTER or NEWELL
+ polygons['HSR'] = 'PAINTER' # PAINTER or NEWELL
# Hidden to the user for now
polygons['EXPANSION_TRICK'] = True
# Hidden to the user for now
polygons['EXPANSION_TRICK'] = True
- # uniq
- posVertList = [ u for u in posVertList if u not in locals()['_[1]'] ]
- negVertList = [ u for u in negVertList if u not in locals()['_[1]'] ]
+ # uniq for python > 2.4
+ #posVertList = [ u for u in posVertList if u not in locals()['_[1]'] ]
+ #negVertList = [ u for u in negVertList if u not in locals()['_[1]'] ]
+
+ # a more portable way
+ posVertList = uniq(posVertList)
+ negVertList = uniq(negVertList)
# If vertex are all on the same half-space, return
# If vertex are all on the same half-space, return