[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23501] branches/soc-2008-mxcurioni/ release/scripts/freestyle/style_modules: Made standard style modules compatible with Python 3.
Tamito Kajiyama
rd6t-kjym at asahi-net.or.jp
Sun Sep 27 02:58:40 CEST 2009
Revision: 23501
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23501
Author: kjym3
Date: 2009-09-27 02:58:38 +0200 (Sun, 27 Sep 2009)
Log Message:
-----------
Made standard style modules compatible with Python 3.
Modified Paths:
--------------
branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/ChainingIterators.py
branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/Functions0D.py
branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/PredicatesB1D.py
branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/PredicatesU0D.py
branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/PredicatesU1D.py
branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/curvature2d.py
branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/freestyle_init.py
branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/shaders.py
branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/sketchy_topology_broken.py
branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/uniformpruning_zsort.py
Modified: branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/ChainingIterators.py
===================================================================
--- branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/ChainingIterators.py 2009-09-27 00:32:20 UTC (rev 23500)
+++ branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/ChainingIterators.py 2009-09-27 00:58:38 UTC (rev 23501)
@@ -156,7 +156,7 @@
if(self._isExternalContour(ave)):
return 1
it.increment()
- print "pyExternlContourChainingIterator : didn't find next edge"
+ print("pyExternlContourChainingIterator : didn't find next edge")
return 0
def traverse(self, iter):
winner = None
@@ -290,7 +290,7 @@
def traverse(self, iter):
winner = None
winnerOrientation = 0
- print self.getCurrentEdge().getId().getFirst(), self.getCurrentEdge().getId().getSecond()
+ print(self.getCurrentEdge().getId().getFirst(), self.getCurrentEdge().getId().getSecond())
it = AdjacencyIterator(iter)
tvertex = self.getVertex()
if type(tvertex) is TVertex:
@@ -303,7 +303,7 @@
winnerOrientation = 1
else:
winnerOrientation = 0
- break
+ break
it.increment()
else:
## case of NonTVertex
@@ -327,7 +327,7 @@
if(winner != None):
# check whether this edge was part of the selection
if(winner.getTimeStamp() != GetTimeStampCF()):
- #print "---", winner.getId().getFirst(), winner.getId().getSecond()
+ #print("---", winner.getId().getFirst(), winner.getId().getSecond())
# if not, let's check whether it's short enough with
# respect to the chain made without staying in the selection
#------------------------------------------------------------
@@ -341,7 +341,7 @@
_it.init()
while(_it.isEnd() == 0):
ve = _it.getObject()
- #print "--------", ve.getId().getFirst(), ve.getId().getSecond()
+ #print("--------", ve.getId().getFirst(), ve.getId().getSecond())
self._length = self._length + ve.getLength2D()
_it.increment()
if(_it.isBegin() != 0):
@@ -353,7 +353,7 @@
_it.decrement()
while ((_it.isEnd() == 0) and (_it.isBegin() == 0)):
ve = _it.getObject()
- #print "--------", ve.getId().getFirst(), ve.getId().getSecond()
+ #print("--------", ve.getId().getFirst(), ve.getId().getSecond())
self._length = self._length + ve.getLength2D()
_it.decrement()
@@ -367,7 +367,7 @@
_cit.init()
while((_cit.isEnd() == 0) and (_cit.getObject().getTimeStamp() != GetTimeStampCF())):
ve = _cit.getObject()
- #print "-------- --------", ve.getId().getFirst(), ve.getId().getSecond()
+ #print("-------- --------", ve.getId().getFirst(), ve.getId().getSecond())
connexl = connexl + ve.getLength2D()
_cit.increment()
if(connexl > self._percent * self._length):
@@ -389,7 +389,7 @@
def traverse(self, iter):
winner = None
winnerOrientation = 0
- #print self.getCurrentEdge().getId().getFirst(), self.getCurrentEdge().getId().getSecond()
+ #print(self.getCurrentEdge().getId().getFirst(), self.getCurrentEdge().getId().getSecond())
it = AdjacencyIterator(iter)
tvertex = self.getVertex()
if type(tvertex) is TVertex:
@@ -402,7 +402,7 @@
winnerOrientation = 1
else:
winnerOrientation = 0
- break
+ break
it.increment()
else:
## case of NonTVertex
@@ -426,7 +426,7 @@
if(winner != None):
# check whether this edge was part of the selection
if(winner.getTimeStamp() != GetTimeStampCF()):
- #print "---", winner.getId().getFirst(), winner.getId().getSecond()
+ #print("---", winner.getId().getFirst(), winner.getId().getSecond())
# nw let's compute the length of this connex non selected part:
connexl = 0
_cit = pyChainSilhouetteGenericIterator(0,0)
@@ -436,7 +436,7 @@
_cit.init()
while((_cit.isEnd() == 0) and (_cit.getObject().getTimeStamp() != GetTimeStampCF())):
ve = _cit.getObject()
- #print "-------- --------", ve.getId().getFirst(), ve.getId().getSecond()
+ #print("-------- --------", ve.getId().getFirst(), ve.getId().getSecond())
connexl = connexl + ve.getLength2D()
_cit.increment()
if(connexl > self._length):
@@ -464,7 +464,7 @@
def traverse(self, iter):
winner = None
winnerOrientation = 0
- print self.getCurrentEdge().getId().getFirst(), self.getCurrentEdge().getId().getSecond()
+ print(self.getCurrentEdge().getId().getFirst(), self.getCurrentEdge().getId().getSecond())
it = AdjacencyIterator(iter)
tvertex = self.getVertex()
if type(tvertex) is TVertex:
@@ -477,7 +477,7 @@
winnerOrientation = 1
else:
winnerOrientation = 0
- break
+ break
it.increment()
else:
## case of NonTVertex
@@ -501,7 +501,7 @@
if(winner != None):
# check whether this edge was part of the selection
if(winner.getTimeStamp() != GetTimeStampCF()):
- #print "---", winner.getId().getFirst(), winner.getId().getSecond()
+ #print("---", winner.getId().getFirst(), winner.getId().getSecond())
# if not, let's check whether it's short enough with
# respect to the chain made without staying in the selection
#------------------------------------------------------------
@@ -515,7 +515,7 @@
_it.init()
while(_it.isEnd() == 0):
ve = _it.getObject()
- #print "--------", ve.getId().getFirst(), ve.getId().getSecond()
+ #print("--------", ve.getId().getFirst(), ve.getId().getSecond())
self._length = self._length + ve.getLength2D()
_it.increment()
if(_it.isBegin() != 0):
@@ -527,7 +527,7 @@
_it.decrement()
while ((_it.isEnd() == 0) and (_it.isBegin() == 0)):
ve = _it.getObject()
- #print "--------", ve.getId().getFirst(), ve.getId().getSecond()
+ #print("--------", ve.getId().getFirst(), ve.getId().getSecond())
self._length = self._length + ve.getLength2D()
_it.decrement()
@@ -541,7 +541,7 @@
_cit.init()
while((_cit.isEnd() == 0) and (_cit.getObject().getTimeStamp() != GetTimeStampCF())):
ve = _cit.getObject()
- #print "-------- --------", ve.getId().getFirst(), ve.getId().getSecond()
+ #print("-------- --------", ve.getId().getFirst(), ve.getId().getSecond())
connexl = connexl + ve.getLength2D()
_cit.increment()
if((connexl > self._percent * self._length) or (connexl > self._absLength)):
@@ -569,7 +569,7 @@
def traverse(self, iter):
winner = None
winnerOrientation = 0
- print self.getCurrentEdge().getId().getFirst(), self.getCurrentEdge().getId().getSecond()
+ print(self.getCurrentEdge().getId().getFirst(), self.getCurrentEdge().getId().getSecond())
it = AdjacencyIterator(iter)
tvertex = self.getVertex()
if type(tvertex) is TVertex:
@@ -582,7 +582,7 @@
winnerOrientation = 1
else:
winnerOrientation = 0
- break
+ break
it.increment()
else:
## case of NonTVertex
@@ -606,7 +606,7 @@
if(winner != None):
# check whether this edge was part of the selection
if(winner.qi() != 0):
- #print "---", winner.getId().getFirst(), winner.getId().getSecond()
+ #print("---", winner.getId().getFirst(), winner.getId().getSecond())
# if not, let's check whether it's short enough with
# respect to the chain made without staying in the selection
#------------------------------------------------------------
@@ -620,7 +620,7 @@
_it.init()
while(_it.isEnd() == 0):
ve = _it.getObject()
- #print "--------", ve.getId().getFirst(), ve.getId().getSecond()
+ #print("--------", ve.getId().getFirst(), ve.getId().getSecond())
self._length = self._length + ve.getLength2D()
_it.increment()
if(_it.isBegin() != 0):
@@ -632,7 +632,7 @@
_it.decrement()
while ((_it.isEnd() == 0) and (_it.isBegin() == 0)):
ve = _it.getObject()
- #print "--------", ve.getId().getFirst(), ve.getId().getSecond()
+ #print("--------", ve.getId().getFirst(), ve.getId().getSecond())
self._length = self._length + ve.getLength2D()
_it.decrement()
@@ -646,7 +646,7 @@
_cit.init()
while((_cit.isEnd() == 0) and (_cit.getObject().qi() != 0)):
ve = _cit.getObject()
- #print "-------- --------", ve.getId().getFirst(), ve.getId().getSecond()
+ #print("-------- --------", ve.getId().getFirst(), ve.getId().getSecond())
connexl = connexl + ve.getLength2D()
_cit.increment()
if((connexl > self._percent * self._length) or (connexl > self._absLength)):
Modified: branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/Functions0D.py
===================================================================
--- branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/Functions0D.py 2009-09-27 00:32:20 UTC (rev 23500)
+++ branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/Functions0D.py 2009-09-27 00:58:38 UTC (rev 23501)
@@ -18,7 +18,7 @@
i0d = inter.getObject()
s = i0d.getExactTypeName()
if (string.find(s, "CurvePoint") == -1):
- print "CurvilinearLengthF0D: not implemented yet for %s" % (s)
+ print("CurvilinearLengthF0D: not implemented yet for", s)
return -1
cp = castToCurvePoint(i0d)
return cp.t2d()
Modified: branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/PredicatesB1D.py
===================================================================
--- branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/PredicatesB1D.py 2009-09-27 00:32:20 UTC (rev 23500)
+++ branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/PredicatesB1D.py 2009-09-27 00:58:38 UTC (rev 23501)
@@ -6,7 +6,7 @@
def getName(self):
return "pyZBP1D"
- def __call__(self, i1, i2):
+ def __call__(self, i1, i2):
func = GetZF1D()
return (func(i1) > func(i2))
@@ -18,21 +18,21 @@
def getName(self):
return "pyZDiscontinuityBP1D"
- def __call__(self, i1, i2):
+ def __call__(self, i1, i2):
return (self._GetZDiscontinuity(i1) > self._GetZDiscontinuity(i2))
class pyLengthBP1D(BinaryPredicate1D):
def getName(self):
return "LengthBP1D"
- def __call__(self, i1, i2):
+ def __call__(self, i1, i2):
return (i1.getLength2D() > i2.getLength2D())
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list