Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-11-24 04:28:01 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-01-28 18:33:57 +0400
commit6498b96ce7081db039354228213d72e8c70bd3aa (patch)
tree17aa60d6dcec97497df8c349b6023f35cd06d78d /release/scripts/freestyle/styles/blueprint_squares.py
parentdf471369e26b08232000763b2128d6f58a916f82 (diff)
Reorganized the Freestyle Python API in a hierarchical package structure.
Both C- and Python-coded API components were rearranged into logical groups. New Python modules are packaged as follows: freestyle - Top-level package freestyle.types - Classes for core data structues (e.g., view map) freestyle.chainingiterators - Pre-defined chaining iterators freestyle.functions - Pre-defined 0D and 1D functions freestyle.predicates - Pre-defined 0D and 1D predicates freestyle.shaders - Pre-defined stroke shaders freestyle.utils - Utility functions The Python modules are installed in scripts/freestyle/modules. Pre-defined styles are installed in scripts/freestyle/styles. To-do: update styles according to the new Freestyle API package structure.
Diffstat (limited to 'release/scripts/freestyle/styles/blueprint_squares.py')
-rw-r--r--release/scripts/freestyle/styles/blueprint_squares.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/release/scripts/freestyle/styles/blueprint_squares.py b/release/scripts/freestyle/styles/blueprint_squares.py
new file mode 100644
index 00000000000..35cfc33fd69
--- /dev/null
+++ b/release/scripts/freestyle/styles/blueprint_squares.py
@@ -0,0 +1,43 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# Filename : blueprint_squares.py
+# Author : Emmanuel Turquin
+# Date : 04/08/2005
+# Purpose : Produces a blueprint using square contour strokes
+
+from freestyle import ChainPredicateIterator, ConstantThicknessShader, ContourUP1D, IncreasingColorShader, \
+ Operators, QuantitativeInvisibilityUP1D, SameShapeIdBP1D, TextureAssignerShader, TrueUP1D
+from PredicatesU1D import pyHigherLengthUP1D
+from logical_operators import AndUP1D, NotUP1D
+from shaders import pyBluePrintSquaresShader, pyPerlinNoise1DShader
+
+upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
+bpred = SameShapeIdBP1D()
+Operators.select(upred)
+Operators.bidirectional_chain(ChainPredicateIterator(upred, bpred), NotUP1D(upred))
+Operators.select(pyHigherLengthUP1D(200))
+shaders_list = [
+ ConstantThicknessShader(8),
+ pyBluePrintSquaresShader(2, 20),
+ pyPerlinNoise1DShader(0.07, 10, 8),
+ TextureAssignerShader(4),
+ IncreasingColorShader(0.6, 0.3, 0.3, 0.7, 0.6, 0.3, 0.3, 0.3),
+ ConstantThicknessShader(4),
+ ]
+Operators.create(TrueUP1D(), shaders_list)