diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-01-27 02:28:04 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-01-27 02:28:04 +0400 |
commit | 9251d628db0abe599d927d79170025d8545c8ace (patch) | |
tree | d020cc3013ce6446390b568b644dcf9bc9187676 /source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp | |
parent | 7ae0c936fa070da0bf10782e77c4500bf9bd57a8 (diff) |
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.
Diffstat (limited to 'source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp')
-rw-r--r-- | source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp index 9631c93cd7e..2ded242e9ea 100644 --- a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp +++ b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp @@ -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::preProcessFace(WXFace *iFace) 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 |