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>2011-12-12 03:41:15 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-12-12 03:41:15 +0400
commit32db495e501e8d36718f50b79bbebad4dbb67d33 (patch)
tree10cbb93885cf4e62f2138cce81dff943c6af8edf /release/scripts/freestyle/style_modules
parent8a182d41b18b739c8b03c2961a2e79ca6d83049c (diff)
Updates on the Parameter Editor mode:
* Added a new chain splitting option for dividing chains into pieces having a given curvilinear 2D length. * Rearranged the UI controls of chain splitting options according to the actual order of processing. * Made changes for converting each view edge into a chain in the case of not using chaining.
Diffstat (limited to 'release/scripts/freestyle/style_modules')
-rw-r--r--release/scripts/freestyle/style_modules/parameter_editor.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/release/scripts/freestyle/style_modules/parameter_editor.py b/release/scripts/freestyle/style_modules/parameter_editor.py
index 3e98d2dcd7a..421ca058a53 100644
--- a/release/scripts/freestyle/style_modules/parameter_editor.py
+++ b/release/scripts/freestyle/style_modules/parameter_editor.py
@@ -818,6 +818,23 @@ class Curvature2DAngleThresholdUP0D(UnaryPredicate0D):
return True
return False
+class Length2DThresholdUP0D(UnaryPredicate0D):
+ def __init__(self, length_limit):
+ UnaryPredicate0D.__init__(self)
+ self._length_limit = length_limit
+ self._t = 0.0
+ def getName(self):
+ return "Length2DThresholdUP0D"
+ def __call__(self, inter):
+ t = inter.t() # curvilinear abscissa
+ if t < self._t:
+ self._t = 0.0
+ return False
+ if t - self._t < self._length_limit:
+ return False
+ self._t = t
+ return True
+
# Seed for random number generation
class Seed:
@@ -939,6 +956,8 @@ def process(layer_name, lineset_name):
Operators.bidirectionalChain(pySketchyChainSilhouetteIterator(linestyle.rounds))
else:
Operators.bidirectionalChain(pySketchyChainingIterator(linestyle.rounds))
+ else:
+ Operators.chain(ChainPredicateIterator(FalseUP1D(), FalseBP1D()), NotUP1D(upred))
# split chains
if linestyle.material_boundary:
Operators.sequentialSplit(MaterialBoundaryUP0D())
@@ -946,6 +965,8 @@ def process(layer_name, lineset_name):
min_angle = linestyle.min_angle if linestyle.use_min_angle else None
max_angle = linestyle.max_angle if linestyle.use_max_angle else None
Operators.sequentialSplit(Curvature2DAngleThresholdUP0D(min_angle, max_angle))
+ if linestyle.use_split_length:
+ Operators.sequentialSplit(Length2DThresholdUP0D(linestyle.split_length), 1.0)
# select chains
if linestyle.use_min_length or linestyle.use_max_length:
min_length = linestyle.min_length if linestyle.use_min_length else None