[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58006] trunk/blender/release/scripts/ freestyle/style_modules/ChainingIterators.py: Partial fix for Bug #35695: Freestyle produces extra line across an object with pointed areas.

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Thu Jul 4 22:24:23 CEST 2013


Revision: 58006
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58006
Author:   kjym3
Date:     2013-07-04 20:24:22 +0000 (Thu, 04 Jul 2013)
Log Message:
-----------
Partial fix for Bug #35695: Freestyle produces extra line across an object with pointed areas.

The reported problem is a visual artefact (extra lines) generated by 
ChainingIterators.pySketchyChainingIterator used for sketchy chaining with the Same Object
option disabled in the Parameter Editor mode.  The issue is caused by an inconsistency in
the internal data structure (i.e., view map).  For now this fatal error condition is addressed
to avoid visually incorrect results.  Another fix will follow to address the cause of the
internal inconsistency.

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

Modified: trunk/blender/release/scripts/freestyle/style_modules/ChainingIterators.py
===================================================================
--- trunk/blender/release/scripts/freestyle/style_modules/ChainingIterators.py	2013-07-04 20:07:00 UTC (rev 58005)
+++ trunk/blender/release/scripts/freestyle/style_modules/ChainingIterators.py	2013-07-04 20:24:22 UTC (rev 58006)
@@ -24,6 +24,8 @@
 from freestyle import AdjacencyIterator, ChainingIterator, ExternalContourUP1D, Nature, TVertex
 from freestyle import ContextFunctions as CF
 
+import bpy
+
 ## the natural chaining iterator
 ## It follows the edges of same nature following the topology of
 ## objects with  preseance on silhouettes, then borders, 
@@ -212,7 +214,7 @@
 										visitNext = 1
 										break
 								if visitNext != 0:
-									break	 
+									break
 							count = count+1
 							winner = ve
 						it.increment()
@@ -238,14 +240,22 @@
 		self._timeStamp = CF.get_time_stamp()+self._nRounds
 	def traverse(self, iter):
 		winner = None
+		found = False
 		it = AdjacencyIterator(iter)
 		while not it.is_end:
 			ve = it.object
 			if ve.id == self.current_edge.id:
+				found = True
 				it.increment()
 				continue
 			winner = ve
 			it.increment()
+		if not found:
+			# This is a fatal error condition: self.current_edge must be found
+			# among the edges seen by the AdjacencyIterator [bug #35695].
+			if bpy.app.debug_freestyle:
+				print('pySketchyChainingIterator: current edge not found')
+			return None
 		if winner is None:
 			winner = self.current_edge
 		if winner.chaining_time_stamp == self._timeStamp:




More information about the Bf-blender-cvs mailing list