[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54112] branches/soc-2008-mxcurioni/source /blender/freestyle/intern: Slightly generalized the crash fix in revision 54111.

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Sat Jan 26 23:28:05 CET 2013


Revision: 54112
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54112
Author:   kjym3
Date:     2013-01-26 22:28:04 +0000 (Sat, 26 Jan 2013)
Log Message:
-----------
Slightly generalized the crash fix in revision 54111.
Also added a warning message to anticipate potential issues due to
the implication of the problem addressed here.

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54111

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/winged_edge/Curvature.cpp

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp	2013-01-26 18:53:16 UTC (rev 54111)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp	2013-01-26 22:28:04 UTC (rev 54112)
@@ -40,6 +40,8 @@
 #include "../geometry/GeomUtils.h"
 #include "../geometry/normal_cycle.h"
 
+#include "BKE_global.h"
+
 void FEdgeXDetector::processShapes(WingedEdge& we)
 {
 	bool progressBarDisplay = false;
@@ -171,6 +173,16 @@
 
 void FEdgeXDetector::computeCurvatures(WXVertex *vertex)
 {
+	// TODO: for some reason, the 'vertex' may have no associated edges
+	// (i.e., WVertex::_EdgeList is empty), which causes a crash due to
+	// a subsequent call of WVertex::_EdgeList.front().
+	if (vertex->GetEdges().empty()) {
+		if (G.debug & G_DEBUG_FREESTYLE) {
+			printf("Warning: WVertex %d has no associated edges.\n", vertex->GetId());
+		}
+		return;
+	}
+
 	// CURVATURE LAYER
 	// store all the curvature datas for each vertex
 

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/winged_edge/Curvature.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/winged_edge/Curvature.cpp	2013-01-26 18:53:16 UTC (rev 54111)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/winged_edge/Curvature.cpp	2013-01-26 22:28:04 UTC (rev 54112)
@@ -586,12 +586,6 @@
 // use marking ? (measure *timings* ...)
 void compute_curvature_tensor(WVertex *start, real radius, NormalCycle& nc)
 {
-	// TODO: for some reason, the WVertex 'start' may have no associated edges
-	// (i.e., WVertex::_EdgeList is empty), which causes a crash due to a call
-	// of WVertex::_EdgeList.front().
-	if (start->GetEdges().empty())
-		return;
-
 	// in case we have a non-manifold vertex, skip it...
 	if (start->isBoundary())
 		return;




More information about the Bf-blender-cvs mailing list