[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60731] trunk/blender/release/scripts/ freestyle/style_modules/parameter_editor.py: Fix for a bug in StrokeCleaner identified through a discussion for Bug #36425 (freestyle edge marks not working).

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Sun Oct 13 20:17:46 CEST 2013


Revision: 60731
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60731
Author:   kjym3
Date:     2013-10-13 18:17:46 +0000 (Sun, 13 Oct 2013)
Log Message:
-----------
Fix for a bug in StrokeCleaner identified through a discussion for Bug #36425 (freestyle edge marks not working).
Many thanks for Anthony Edlin who helped fix the issue.

Modified Paths:
--------------
    trunk/blender/release/scripts/freestyle/style_modules/parameter_editor.py

Modified: trunk/blender/release/scripts/freestyle/style_modules/parameter_editor.py
===================================================================
--- trunk/blender/release/scripts/freestyle/style_modules/parameter_editor.py	2013-10-13 18:14:38 UTC (rev 60730)
+++ trunk/blender/release/scripts/freestyle/style_modules/parameter_editor.py	2013-10-13 18:17:46 UTC (rev 60731)
@@ -32,7 +32,7 @@
     FalseBP1D, FalseUP1D, GuidingLinesShader, Interface0DIterator, Nature, Noise, Normal2DF0D, Operators, \
     PolygonalizationShader, QuantitativeInvisibilityF1D, QuantitativeInvisibilityUP1D, SamplingShader, \
     SpatialNoiseShader, StrokeAttribute, StrokeShader, TipRemoverShader, TrueBP1D, TrueUP1D, UnaryPredicate0D, \
-    UnaryPredicate1D, VertexOrientation2DF0D, WithinImageBoundaryUP1D, ContextFunctions
+    UnaryPredicate1D, VertexOrientation2DF0D, WithinImageBoundaryUP1D, ContextFunctions, TVertex
 from Functions0D import CurveMaterialF0D
 from PredicatesU1D import pyNatureUP1D
 from logical_operators import AndUP1D, NotUP1D, OrUP1D
@@ -1085,6 +1085,8 @@
             it3.increment()
             it4.increment()
 
+def is_tvertex(svertex):
+    return type(svertex.viewvertex) is TVertex
 
 class StrokeCleaner(StrokeShader):
     def shade(self, stroke):
@@ -1092,7 +1094,10 @@
             seg1 = sv2.point - sv1.point
             seg2 = sv3.point - sv2.point
             seg3 = sv4.point - sv3.point
-            if seg1.dot(seg2) < 0.0 and seg2.dot(seg3) < 0.0:
+            if not ((is_tvertex(sv2.first_svertex) and is_tvertex(sv2.second_svertex)) or
+                    (is_tvertex(sv3.first_svertex) and is_tvertex(sv3.second_svertex))):
+                continue
+            if seg1.dot(seg2) < 0.0 and seg2.dot(seg3) < 0.0 and seg2.length < 0.01:
                 #print(sv2.first_svertex.viewvertex)
                 #print(sv2.second_svertex.viewvertex)
                 #print(sv3.first_svertex.viewvertex)




More information about the Bf-blender-cvs mailing list