[Bf-blender-cvs] [054094f] master: Freestyle: Fix for chaining operators not concatenating edges with Freestyle edge marks and at material boundaries. Problem report by Postoman on the BlenderArtists.org Freestyle thread, thanks a lot!

Tamito Kajiyama noreply at git.blender.org
Wed Feb 12 10:18:21 CET 2014


Commit: 054094f5827f3b6c0c1a6316c2e624f197244ec8
Author: Tamito Kajiyama
Date:   Wed Feb 12 16:13:06 2014 +0900
https://developer.blender.org/rB054094f5827f3b6c0c1a6316c2e624f197244ec8

Freestyle: Fix for chaining operators not concatenating edges with Freestyle edge marks and at material boundaries.
Problem report by Postoman on the BlenderArtists.org Freestyle thread, thanks a lot!

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

M	release/scripts/freestyle/modules/freestyle/chainingiterators.py
M	source/blender/freestyle/intern/stroke/ChainingIterators.cpp

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

diff --git a/release/scripts/freestyle/modules/freestyle/chainingiterators.py b/release/scripts/freestyle/modules/freestyle/chainingiterators.py
index 4b2cc9a..c4e2219 100644
--- a/release/scripts/freestyle/modules/freestyle/chainingiterators.py
+++ b/release/scripts/freestyle/modules/freestyle/chainingiterators.py
@@ -72,7 +72,8 @@ class pyChainSilhouetteIterator(ChainingIterator):
                 it.increment()
         else:
             ## case of NonTVertex
-            natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
+            natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.MATERIAL_BOUNDARY,Nature.EDGE_MARK,
+                       Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
             for i in range(len(natures)):
                 currentNature = self.current_edge.nature
                 if (natures[i] & currentNature) != 0:
@@ -130,7 +131,8 @@ class pyChainSilhouetteGenericIterator(ChainingIterator):
                 it.increment()
         else:
             ## case of NonTVertex
-            natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
+            natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.MATERIAL_BOUNDARY,Nature.EDGE_MARK,
+                       Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
             for i in range(len(natures)):
                 currentNature = self.current_edge.nature
                 if (natures[i] & currentNature) != 0:
@@ -243,7 +245,8 @@ class pySketchyChainSilhouetteIterator(ChainingIterator):
                 it.increment()
         else:
             ## case of NonTVertex
-            natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
+            natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.MATERIAL_BOUNDARY,Nature.EDGE_MARK,
+                       Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
             for i in range(len(natures)):
                 currentNature = self.current_edge.nature
                 if (natures[i] & currentNature) != 0:
@@ -352,7 +355,8 @@ class pyFillOcclusionsRelativeChainingIterator(ChainingIterator):
                 it.increment()
         else:
             ## case of NonTVertex
-            natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
+            natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.MATERIAL_BOUNDARY,Nature.EDGE_MARK,
+                       Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
             for nat in natures:
                 if (self.current_edge.nature & nat) != 0:
                     count=0
@@ -448,7 +452,8 @@ class pyFillOcclusionsAbsoluteChainingIterator(ChainingIterator):
                 it.increment()
         else:
             ## case of NonTVertex
-            natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
+            natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.MATERIAL_BOUNDARY,Nature.EDGE_MARK,
+                       Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
             for nat in natures:
                 if (self.current_edge.nature & nat) != 0:
                     count=0
@@ -520,7 +525,8 @@ class pyFillOcclusionsAbsoluteAndRelativeChainingIterator(ChainingIterator):
                 it.increment()
         else:
             ## case of NonTVertex
-            natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
+            natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.MATERIAL_BOUNDARY,Nature.EDGE_MARK,
+                       Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
             for nat in natures:
                 if (self.current_edge.nature & nat) != 0:
                     count=0
@@ -622,7 +628,8 @@ class pyFillQi0AbsoluteAndRelativeChainingIterator(ChainingIterator):
                 it.increment()
         else:
             ## case of NonTVertex
-            natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
+            natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.MATERIAL_BOUNDARY,Nature.EDGE_MARK,
+                       Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
             for nat in natures:
                 if (self.current_edge.nature & nat) != 0:
                     count=0
@@ -744,7 +751,8 @@ class pyNoIdChainSilhouetteIterator(ChainingIterator):
                 it.increment()
         else:
             ## case of NonTVertex
-            natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
+            natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.MATERIAL_BOUNDARY,Nature.EDGE_MARK,
+                       Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
             for i in range(len(natures)):
                 currentNature = self.current_edge.nature
                 if (natures[i] & currentNature) != 0:
diff --git a/source/blender/freestyle/intern/stroke/ChainingIterators.cpp b/source/blender/freestyle/intern/stroke/ChainingIterators.cpp
index 4408f5c..2f193ce 100644
--- a/source/blender/freestyle/intern/stroke/ChainingIterators.cpp
+++ b/source/blender/freestyle/intern/stroke/ChainingIterators.cpp
@@ -140,11 +140,13 @@ int ChainSilhouetteIterator::traverse(const AdjacencyIterator& ait)
 		//soc NonTVertex *nontvertex = (NonTVertex*)nextVertex;
 		ViewEdge *newEdge(0);
 		// we'll try to chain the edges by keeping the same nature...
-		// the preseance order is : SILHOUETTE, BORDER, CREASE, SUGGESTIVE, VALLEY, RIDGE
-		Nature::EdgeNature natures[6] = {
+		// the preseance order is : SILHOUETTE, BORDER, CREASE, MATERIAL_BOUNDARY, EDGE_MARK, SUGGESTIVE, VALLEY, RIDGE
+		Nature::EdgeNature natures[8] = {
 			Nature::SILHOUETTE,
 			Nature::BORDER,
 			Nature::CREASE,
+			Nature::MATERIAL_BOUNDARY,
+			Nature::EDGE_MARK,
 			Nature::SUGGESTIVE_CONTOUR,
 			Nature::VALLEY,
 			Nature::RIDGE




More information about the Bf-blender-cvs mailing list