[Bf-blender-cvs] [a283b09] master: Code cleanup: pep8

Campbell Barton noreply at git.blender.org
Tue Jan 28 16:22:11 CET 2014


Commit: a283b099b13a24b0361f9c063caa9426a70de1e4
Author: Campbell Barton
Date:   Wed Jan 29 02:16:16 2014 +1100
https://developer.blender.org/rBa283b099b13a24b0361f9c063caa9426a70de1e4

Code cleanup: pep8

===================================================================

M	release/scripts/freestyle/modules/freestyle/chainingiterators.py
M	release/scripts/freestyle/modules/freestyle/functions.py
M	release/scripts/freestyle/modules/freestyle/predicates.py
M	release/scripts/freestyle/modules/freestyle/shaders.py
M	release/scripts/freestyle/modules/parameter_editor.py
M	release/scripts/freestyle/styles/apriori_density.py
M	release/scripts/freestyle/styles/long_anisotropically_dense.py
M	release/scripts/freestyle/styles/multiple_parameterization.py

===================================================================

diff --git a/release/scripts/freestyle/modules/freestyle/chainingiterators.py b/release/scripts/freestyle/modules/freestyle/chainingiterators.py
index aad82d1..4b2cc9a 100644
--- a/release/scripts/freestyle/modules/freestyle/chainingiterators.py
+++ b/release/scripts/freestyle/modules/freestyle/chainingiterators.py
@@ -54,8 +54,10 @@ class pyChainSilhouetteIterator(ChainingIterator):
     """
     def __init__(self, stayInSelection=True):
         ChainingIterator.__init__(self, stayInSelection, True, None, True)
+
     def init(self):
         pass
+
     def traverse(self, iter):
         winner = None
         it = AdjacencyIterator(iter)
@@ -110,8 +112,10 @@ class pyChainSilhouetteGenericIterator(ChainingIterator):
 
     def __init__(self, stayInSelection=True, stayInUnvisited=True):
         ChainingIterator.__init__(self, stayInSelection, stayInUnvisited, None, True)
+
     def init(self):
         pass
+
     def traverse(self, iter):
         winner = None
         it = AdjacencyIterator(iter)
@@ -161,9 +165,11 @@ class pyExternalContourChainingIterator(ChainingIterator):
     def __init__(self):
         ChainingIterator.__init__(self, False, True, None, True)
         self._isExternalContour = ExternalContourUP1D()
+
     def init(self):
         self._nEdges = 0
         self._isInSelection = 1
+
     def checkViewEdge(self, ve, orientation):
         if orientation != 0:
             vertex = ve.second_svertex()
@@ -178,6 +184,7 @@ class pyExternalContourChainingIterator(ChainingIterator):
         if bpy.app.debug_freestyle:
             print("pyExternalContourChainingIterator : didn't find next edge")
         return False
+
     def traverse(self, iter):
         winner = None
         it = AdjacencyIterator(iter)
@@ -218,8 +225,10 @@ class pySketchyChainSilhouetteIterator(ChainingIterator):
         ChainingIterator.__init__(self, stayInSelection, False, None, True)
         self._timeStamp = CF.get_time_stamp()+nRounds
         self._nRounds = nRounds
+
     def init(self):
         self._timeStamp = CF.get_time_stamp()+self._nRounds
+
     def traverse(self, iter):
         winner = None
         it = AdjacencyIterator(iter)
@@ -277,8 +286,10 @@ class pySketchyChainingIterator(ChainingIterator):
         ChainingIterator.__init__(self, stayInSelection, False, None, True)
         self._timeStamp = CF.get_time_stamp()+nRounds
         self._nRounds = nRounds
+
     def init(self):
         self._timeStamp = CF.get_time_stamp()+self._nRounds
+
     def traverse(self, iter):
         winner = None
         found = False
@@ -316,10 +327,12 @@ class pyFillOcclusionsRelativeChainingIterator(ChainingIterator):
         ChainingIterator.__init__(self, False, True, None, True)
         self._length = 0
         self._percent = float(percent)
+
     def init(self):
         # A chain's length should preferably be evaluated only once.
         # Therefore, the chain length is reset here.
         self._length = 0
+
     def traverse(self, iter):
         winner = None
 
@@ -414,8 +427,10 @@ class pyFillOcclusionsAbsoluteChainingIterator(ChainingIterator):
     def __init__(self, length):
         ChainingIterator.__init__(self, False, True, None, True)
         self._length = float(length)
+
     def init(self):
         pass
+
     def traverse(self, iter):
         winner = None
         winnerOrientation = False
@@ -481,11 +496,13 @@ class pyFillOcclusionsAbsoluteAndRelativeChainingIterator(ChainingIterator):
         self._length = 0
         self._absLength = l
         self._percent = float(percent)
+
     def init(self):
         # each time we're evaluating a chain length
         # we try to do it once. Thus we reinit
         # the chain length here:
         self._length = 0
+
     def traverse(self, iter):
         winner = None
         winnerOrientation = False
@@ -581,10 +598,12 @@ class pyFillQi0AbsoluteAndRelativeChainingIterator(ChainingIterator):
         self._length = 0
         self._absLength = l
         self._percent = float(percent)
+
     def init(self):
         # A chain's length should preverably be evaluated only once.
         # Therefore, the chain length is reset here.
         self._length = 0
+
     def traverse(self, iter):
         winner = None
         winnerOrientation = False
@@ -682,8 +701,10 @@ class pyNoIdChainSilhouetteIterator(ChainingIterator):
 
     def __init__(self, stayInSelection=True):
         ChainingIterator.__init__(self, stayInSelection, True, None, True)
+
     def init(self):
         pass
+
     def traverse(self, iter):
         winner = None
         it = AdjacencyIterator(iter)
diff --git a/release/scripts/freestyle/modules/freestyle/functions.py b/release/scripts/freestyle/modules/freestyle/functions.py
index 686dce6..379e933 100644
--- a/release/scripts/freestyle/modules/freestyle/functions.py
+++ b/release/scripts/freestyle/modules/freestyle/functions.py
@@ -94,6 +94,7 @@ from mathutils import Vector
 ## Functions for 0D elements (vertices)
 #######################################
 
+
 class CurveMaterialF0D(UnaryFunction0DMaterial):
     """
     A replacement of the built-in MaterialF0D for stroke creation.
@@ -106,18 +107,21 @@ class CurveMaterialF0D(UnaryFunction0DMaterial):
         assert(fe is not None)
         return fe.material if fe.is_smooth else fe.material_left
 
+
 class pyInverseCurvature2DAngleF0D(UnaryFunction0DDouble):
     def __call__(self, inter):
         func = Curvature2DAngleF0D()
         c = func(inter)
         return (3.1415 - c)
 
+
 class pyCurvilinearLengthF0D(UnaryFunction0DDouble):
     def __call__(self, inter):
         cp = inter.object
         assert(isinstance(cp, CurvePoint))
         return cp.t2d
 
+
 class pyDensityAnisotropyF0D(UnaryFunction0DDouble):
     """Estimates the anisotropy of density"""
     def __init__(self,level):
@@ -127,6 +131,7 @@ class pyDensityAnisotropyF0D(UnaryFunction0DDouble):
         self.d1Density = ReadSteerableViewMapPixelF0D(1, level)
         self.d2Density = ReadSteerableViewMapPixelF0D(2, level)
         self.d3Density = ReadSteerableViewMapPixelF0D(3, level)
+
     def __call__(self, inter):
         c_iso = self.IsoDensity(inter)
         c_0 = self.d0Density(inter)
@@ -141,6 +146,7 @@ class pyDensityAnisotropyF0D(UnaryFunction0DDouble):
             v = (cMax-cMin)/c_iso
         return v
 
+
 class pyViewMapGradientVectorF0D(UnaryFunction0DVec2f):
     """Returns the gradient vector for a pixel
 
@@ -151,6 +157,7 @@ class pyViewMapGradientVectorF0D(UnaryFunction0DVec2f):
         UnaryFunction0DVec2f.__init__(self)
         self._l = level
         self._step = pow(2, self._l)
+
     def __call__(self, iter):
         p = iter.object.point_2d
         gx = CF.read_complete_view_map_pixel(self._l, int(p.x+self._step), int(p.y)) - \
@@ -159,11 +166,13 @@ class pyViewMapGradientVectorF0D(UnaryFunction0DVec2f):
             CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
         return Vector((gx, gy))
 
+
 class pyViewMapGradientNormF0D(UnaryFunction0DDouble):
     def __init__(self, l):
         UnaryFunction0DDouble.__init__(self)
         self._l = l
         self._step = pow(2,self._l)
+
     def __call__(self, iter):
         p = iter.object.point_2d
         gx = CF.read_complete_view_map_pixel(self._l, int(p.x+self._step), int(p.y)) - \
@@ -176,34 +185,40 @@ class pyViewMapGradientNormF0D(UnaryFunction0DDouble):
 ## Functions for 1D elements (curves)
 #####################################
 
+
 class pyGetInverseProjectedZF1D(UnaryFunction1DDouble):
     def __call__(self, inter):
         func = GetProjectedZF1D()
         z = func(inter)
         return (1.0 - z)
 
+
 class pyGetSquareInverseProjectedZF1D(UnaryFunction1DDouble):
     def __call__(self, inter):
         func = GetProjectedZF1D()
         z = func(inter)
         return (1.0 - z*z)
 
+
 class pyDensityAnisotropyF1D(UnaryFunction1DDouble):
     def __init__(self,level,  integrationType=IntegrationType.MEAN, sampling=2.0):
         UnaryFunction1DDouble.__init__(self, integrationType)
         self._func = pyDensityAnisotropyF0D(level)
         self._integration = integrationType
         self._sampling = sampling
+
     def __call__(self, inter):
         v = integrate(self._func, inter.points_begin(self._sampling), inter.points_end(self._sampling), self._integration)
         return v
 
+
 class pyViewMapGradientNormF1D(UnaryFunction1DDouble):
     def __init__(self,l, integrationType, sampling=2.0):
         UnaryFunction1DDouble.__init__(self, integrationType)
         self._func = pyViewMapGradientNormF0D(l)
         self._integration = integrationType
         self._sampling = sampling
+
     def __call__(self, inter):
         v = integrate(self._func, inter.points_begin(self._sampling), inter.points_end(self._sampling), self._integration)
         return v
diff --git a/release/scripts/freestyle/modules/freestyle/predicates.py b/release/scripts/freestyle/modules/freestyle/predicates.py
index ab702f1..0801795 100644
--- a/release/scripts/freestyle/modules/freestyle/predicates.py
+++ b/release/scripts/freestyle/modules/freestyle/predicates.py
@@ -80,29 +80,35 @@ class pyHigherCurvature2DAngleUP0D(UnaryPredicate0D):
     def __init__(self,a):
         UnaryPredicate0D.__init__(self)
         self._a = a
+
     def __call__(self, inter):
         func = Curvature2DAngleF0D()
         a = func(inter)
         return (a > self._a)
 
+
 class pyUEqualsUP0D(UnaryPredicate0D):
     def __init__(self,u, w):
         UnaryPredicate0D.__init__(self)
         self._u = u
         self._w = w
+
     def __call__(self, inter):
         func = pyCurvilinearLengthF0D()
         u = func(inter)
         return (u > (self._u-self._w)) and (u < (self._u+self._w))
 
+
 class pyVertexNatureUP0D(UnaryPredicate0D):
     def __init__(self,nature):
         UnaryPredicate0D.__init__(self)
         self._nature = nature
+
     def __call__(self, inter):
         v = inter.object
         return (v.nature & self._nature) != 0
 
+
 ## check whether an Interface0DIterator
 ## is a TVertex and is the one that is
 ## hidden (inferred from the context)
@@ -110,6 +116,7 @@ class pyBackTVertexUP0D(UnaryPredicate0D):
     def __init__

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list