Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-02-22 04:39:56 +0300
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-02-22 04:39:56 +0300
commitecd76d99d64d76846f9f1ed24c54a82b6e9ad041 (patch)
treec58c376e7c82cbb42838630c3a109cdf16019b84 /source/blender/freestyle/intern/view_map
parent70aa63306ad3ec1402275ed623b745d06d14db18 (diff)
Consolidation of stroke drawing.
Fixed a complicated bug that caused a failure of CurvePoint::getFEdge() which had affected a number of C/Python API functions such as MaterialF0D. The current view map building procedure may generate ViewEdges whose two-dimensional (2D) length is almost or exactly zero. Such a zero-length ViewEdge is possibly chained with other ViewEdges to form a stroke. When the stroke is finally generated by Operators::create(), an attempt to remove redundant vertices at the same 2D point is made. This possibly breaks the links of ViewEdges on top of which the stroke has been built, and eventually result in a fatal error of CurvePoint::getFEdge() when API functions that rely on this method are called from within a style module. The present fix addresses this issue by automatically removing zero-length ViewEdges (and Chains of them) before stroke drawing is started and after splitting is performed (e.g., using Operators::sequentialSplit()).
Diffstat (limited to 'source/blender/freestyle/intern/view_map')
-rwxr-xr-xsource/blender/freestyle/intern/view_map/ViewMap.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/view_map/ViewMap.h b/source/blender/freestyle/intern/view_map/ViewMap.h
index 623348b61a7..a0e60ff7bd7 100755
--- a/source/blender/freestyle/intern/view_map/ViewMap.h
+++ b/source/blender/freestyle/intern/view_map/ViewMap.h
@@ -1353,6 +1353,10 @@ void ViewShape::SplitEdge(FEdge *fe,
// a new edge, A'B is created.
FEdge *newEdge = shape->SplitEdgeIn2(fe, sv);
+ /*
+ * One of the two FEdges (fe and newEdge) may have a 2D length less than M_EPSILON.
+ * (22 Feb 2011, T.K.)
+ */
ioNewEdges.push_back(newEdge);
ViewEdge *newVEdge;