[Bf-blender-cvs] [d5d5406] master: Freestyle: minor revisions of Python API docstrings and comments.

Tamito Kajiyama noreply at git.blender.org
Thu Jul 24 07:29:56 CEST 2014


Commit: d5d540615b7ddbfa86bb6f1b260e42f11c28789f
Author: Tamito Kajiyama
Date:   Thu Jul 24 11:44:31 2014 +0900
Branches: master
https://developer.blender.org/rBd5d540615b7ddbfa86bb6f1b260e42f11c28789f

Freestyle: minor revisions of Python API docstrings and comments.

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

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/freestyle/types.py
M	release/scripts/freestyle/modules/freestyle/utils.py
M	release/scripts/freestyle/modules/parameter_editor.py

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

diff --git a/release/scripts/freestyle/modules/freestyle/chainingiterators.py b/release/scripts/freestyle/modules/freestyle/chainingiterators.py
index 5cd0dfe..8d144bf 100644
--- a/release/scripts/freestyle/modules/freestyle/chainingiterators.py
+++ b/release/scripts/freestyle/modules/freestyle/chainingiterators.py
@@ -77,7 +77,7 @@ NATURES = (
 
 
 def nature_in_preceding(nature, index):
-    """ Returns True if given nature appears before index, else False """
+    """Returns True if given nature appears before index, else False."""
     return any(nature & nat for nat in NATURES[:index])
 
 
diff --git a/release/scripts/freestyle/modules/freestyle/functions.py b/release/scripts/freestyle/modules/freestyle/functions.py
index 8511989..674c1f0 100644
--- a/release/scripts/freestyle/modules/freestyle/functions.py
+++ b/release/scripts/freestyle/modules/freestyle/functions.py
@@ -19,7 +19,7 @@
 """
 Functions operating on vertices (0D elements) and polylines (1D
 elements).  Also intended to be a collection of examples for predicate
-definition in Python
+definition in Python.
 """
 
 # module members
@@ -97,7 +97,7 @@ from mathutils import Vector
 class CurveMaterialF0D(UnaryFunction0DMaterial):
     """
     A replacement of the built-in MaterialF0D for stroke creation.
-    MaterialF0D does not work with Curves and Strokes. Line color
+    MaterialF0D does not work with Curves and Strokes.  Line color
     priority is used to pick one of the two materials at material
     boundaries.
 
@@ -128,7 +128,7 @@ class pyCurvilinearLengthF0D(UnaryFunction0DDouble):
 
 
 class pyDensityAnisotropyF0D(UnaryFunction0DDouble):
-    """Estimates the anisotropy of density"""
+    """Estimates the anisotropy of density."""
     def __init__(self, level):
         UnaryFunction0DDouble.__init__(self)
         self.IsoDensity = ReadCompleteViewMapPixelF0D(level)
@@ -149,7 +149,7 @@ class pyDensityAnisotropyF0D(UnaryFunction0DDouble):
 
 
 class pyViewMapGradientVectorF0D(UnaryFunction0DVec2f):
-    """Returns the gradient vector for a pixel
+    """Returns the gradient vector for a pixel.
 
     :arg level: the level at which to compute the gradient
     :type level: int
diff --git a/release/scripts/freestyle/modules/freestyle/predicates.py b/release/scripts/freestyle/modules/freestyle/predicates.py
index 7192917..344b89d 100644
--- a/release/scripts/freestyle/modules/freestyle/predicates.py
+++ b/release/scripts/freestyle/modules/freestyle/predicates.py
@@ -112,9 +112,8 @@ class pyVertexNatureUP0D(UnaryPredicate0D):
 
 class pyBackTVertexUP0D(UnaryPredicate0D):
     """
-    Check whether an Interface0DIterator
-    references a TVertex and is the one that is
-    hidden (inferred from the context)
+    Check whether an Interface0DIterator references a TVertex and is
+    the one that is hidden (inferred from the context).
     """
     def __init__(self):
         UnaryPredicate0D.__init__(self)
diff --git a/release/scripts/freestyle/modules/freestyle/shaders.py b/release/scripts/freestyle/modules/freestyle/shaders.py
index 8a9faf2..502d9b6 100644
--- a/release/scripts/freestyle/modules/freestyle/shaders.py
+++ b/release/scripts/freestyle/modules/freestyle/shaders.py
@@ -23,7 +23,7 @@
 
 """
 Stroke shaders used for creation of stylized strokes.  Also intended
-to be a collection of examples for shader definition in Python
+to be a collection of examples for shader definition in Python.
 """
 
 # module members
@@ -100,7 +100,7 @@ from random import randint
 class pyDepthDiscontinuityThicknessShader(StrokeShader):
     """
     Assigns a thickness to the stroke based on the stroke's distance
-    to the camera (Z-value)
+    to the camera (Z-value).
     """
     def __init__(self, min, max):
         StrokeShader.__init__(self)
@@ -118,7 +118,7 @@ class pyDepthDiscontinuityThicknessShader(StrokeShader):
 
 class pyConstantThicknessShader(StrokeShader):
     """
-    Assigns a constant thickness along the stroke
+    Assigns a constant thickness along the stroke.
     """
     def __init__(self, thickness):
         StrokeShader.__init__(self)
@@ -131,7 +131,7 @@ class pyConstantThicknessShader(StrokeShader):
 
 class pyFXSVaryingThicknessWithDensityShader(StrokeShader):
     """
-    Assings thickness to a stroke based on the density of the diffuse map
+    Assings thickness to a stroke based on the density of the diffuse map.
     """
     def __init__(self, wsize, threshold_min, threshold_max, thicknessMin, thicknessMax):
         StrokeShader.__init__(self)
@@ -155,7 +155,7 @@ class pyFXSVaryingThicknessWithDensityShader(StrokeShader):
 
 class pyIncreasingThicknessShader(StrokeShader):
     """
-    Increasingly thickens the stroke
+    Increasingly thickens the stroke.
     """
     def __init__(self, thicknessMin, thicknessMax):
         StrokeShader.__init__(self)
@@ -176,7 +176,7 @@ class pyIncreasingThicknessShader(StrokeShader):
 class pyConstrainedIncreasingThicknessShader(StrokeShader):
     """
     Increasingly thickens the stroke, constrained by a ratio of the
-    stroke's length
+    stroke's length.
     """
     def __init__(self, thicknessMin, thicknessMax, ratio):
         StrokeShader.__init__(self)
@@ -203,7 +203,7 @@ class pyConstrainedIncreasingThicknessShader(StrokeShader):
 
 class pyDecreasingThicknessShader(StrokeShader):
     """
-    Inverse of pyIncreasingThicknessShader, decreasingly thickens the stroke
+    Inverse of pyIncreasingThicknessShader, decreasingly thickens the stroke.
     """
     def __init__(self, thicknessMin, thicknessMax):
         StrokeShader.__init__(self)
@@ -224,7 +224,7 @@ class pyDecreasingThicknessShader(StrokeShader):
 
 class pyNonLinearVaryingThicknessShader(StrokeShader):
     """
-    Assigns thickness to a stroke based on an exponential function
+    Assigns thickness to a stroke based on an exponential function.
     """
     def __init__(self, thicknessExtremity, thicknessMiddle, exponent):
         self._thicknessMin = thicknessMiddle
@@ -243,7 +243,7 @@ class pyNonLinearVaryingThicknessShader(StrokeShader):
 
 class pySLERPThicknessShader(StrokeShader):
     """
-    Assigns thickness to a stroke based on spherical linear interpolation
+    Assigns thickness to a stroke based on spherical linear interpolation.
     """
     def __init__(self, thicknessMin, thicknessMax, omega=1.2):
         StrokeShader.__init__(self)
@@ -267,7 +267,7 @@ class pySLERPThicknessShader(StrokeShader):
 
 class pyTVertexThickenerShader(StrokeShader):
     """
-    Thickens TVertices (visual intersections between two edges)
+    Thickens TVertices (visual intersections between two edges).
     """
     def __init__(self, a=1.5, n=3):
         StrokeShader.__init__(self)
@@ -297,7 +297,7 @@ class pyImportance2DThicknessShader(StrokeShader):
     """
     Assigns thickness based on distance to a given point in 2D space.
     the thickness is inverted, so the vertices closest to the
-    specified point have the lowest thickness
+    specified point have the lowest thickness.
     """
     def __init__(self, x, y, w, kmin, kmax):
         StrokeShader.__init__(self)
@@ -317,7 +317,7 @@ class pyImportance2DThicknessShader(StrokeShader):
 
 class pyImportance3DThicknessShader(StrokeShader):
     """
-    Assigns thickness based on distance to a given point in 3D space
+    Assigns thickness based on distance to a given point in 3D space.
     """
     def __init__(self, x, y, z, w, kmin, kmax):
         StrokeShader.__init__(self)
@@ -338,7 +338,7 @@ class pyImportance3DThicknessShader(StrokeShader):
 class pyZDependingThicknessShader(StrokeShader):
     """
     Assigns thickness based on an object's local Z depth (point
-    closest to camera is 1, point furthest from camera is zero)
+    closest to camera is 1, point furthest from camera is zero).
     """
     def __init__(self, min, max):
         StrokeShader.__init__(self)
@@ -363,7 +363,7 @@ class pyZDependingThicknessShader(StrokeShader):
 
 class pyConstantColorShader(StrokeShader):
     """
-    Assigns a constant color to the stroke
+    Assigns a constant color to the stroke.
     """
     def __init__(self,r,g,b, a = 1):
         StrokeShader.__init__(self)
@@ -377,7 +377,7 @@ class pyConstantColorShader(StrokeShader):
 
 class pyIncreasingColorShader(StrokeShader):
     """
-    Fades from one color to another along the stroke
+    Fades from one color to another along the stroke.
     """
     def __init__(self,r1,g1,b1,a1, r2,g2,b2,a2):
         StrokeShader.__init__(self)
@@ -397,7 +397,7 @@ class pyIncreasingColorShader(StrokeShader):
 
 class pyInterpolateColorShader(StrokeShader):
     """
-    Fades from one color to another and back
+    Fades from one color to another and back.
     """
     def __init__(self,r1,g1,b1,a1, r2,g2,b2,a2):
         StrokeShader.__init__(self)
@@ -431,7 +431,7 @@ class pyModulateAlphaShader(StrokeShader):
 
 class pyMaterialColorShader(StrokeShader):
     """
-    Assigns the color of the underlying material to the stroke
+    Assigns the color of the underlying material to the stroke.
     """
     def __init__(self, threshold=50):
         StrokeShader.__init__(self)
@@ -493,7 +493,7 @@ class pyMaterialColorShader(StrokeShader):
 
 class pyRandomColorShader(StrokeShader):
     """
-    Assigns a color to the stroke based on given seed
+    Assigns a color to the stroke based on given seed.
     """
     def __init__(self, s=1):
         StrokeShader.__init__(self)
@@ -510,7 +510,7 @@ class pyRandomColorShader(StrokeShader):
 class py2DCurvatureColorShader(StrokeShader):
     """
     Assigns a color (greyscale) to the stroke based on the curvature.
-    A higher curvature will yield a brighter color
+    A higher curvature will yield a brighter color.
     """
     def shade(self, stroke):
         func = Curvature2DAngleF0D()
@@ -526,7 +526,7 @@ class py2DCurvatureColorShader(StrokeShader):
 class pyTimeColorShader(StrokeShader):
     """
     Assigns a greyscale value that increases for every vertex.
-    The brightness will increase along the stroke
+    The brightness will increase along the stroke.
     """
     def __init__(self, step=0.01):
         StrokeShader.__init__(self)
@@ -543,7 +543,7 @@ class pyT

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list