diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-01-31 23:57:39 +0300 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-01-31 23:57:39 +0300 |
commit | 949a752dddacdb8f48f9ab1d5aa99da63d1da839 (patch) | |
tree | d0215ceaec4d50ed4c1d44a65c0b8702661be8ac /source | |
parent | 4e9a519e223a467a069d37eedef6f44081ba525a (diff) |
Made stroke rendering stability fixes, with the aim of addressing
occasional unexpected long lines.
1. The Parameter Editor mode was extended to prevent strokes from
doing quick U-turns that "enable" a known bug in strip creation
that generates unexpected long lines in question.
2. A verbose warning message was added to make the existence of
the strip creation bug visible to users. When the bug affects the
stroke rendering, the following warning shows up in the console:
> Warning: problem in strip creation (the strip is most likely doing a U-turn).
3. The extrapolation option of CurveMapping (used in alpha and
thickness modifiers in the Parameter Editor mode) was identified
as another source of unexpected long lines. Now the extrapolation
option is unconditionally disabled (even when users enable it
through the GUI).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/freestyle/intern/python/BPy_Freestyle.cpp | 6 | ||||
-rwxr-xr-x | source/blender/freestyle/intern/stroke/StrokeRep.cpp | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp index 2755dea1cb7..d39efe5693f 100644 --- a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp +++ b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp @@ -172,6 +172,7 @@ static PyObject *Freestyle_evaluateColorRamp( PyObject *self, PyObject *args ) return newVectorObject( out, 4, Py_NEW, NULL); } +#include "DNA_color_types.h" #include "BKE_colortools.h" /* curvemapping_evaluateF() */ static char Freestyle_evaluateCurveMappingF___doc__[] = @@ -206,6 +207,11 @@ static PyObject *Freestyle_evaluateCurveMappingF( PyObject *self, PyObject *args return NULL; } cumap = (CurveMapping *)py_srna->ptr.data; + /* disable extrapolation if enabled */ + if ((cumap->cm[cur].flag & CUMA_EXTEND_EXTRAPOLATE)) { + cumap->cm[cur].flag &= ~( CUMA_EXTEND_EXTRAPOLATE ); + curvemapping_changed(cumap, 0); + } return PyFloat_FromDouble(curvemapping_evaluateF(cumap, cur, value)); } diff --git a/source/blender/freestyle/intern/stroke/StrokeRep.cpp b/source/blender/freestyle/intern/stroke/StrokeRep.cpp index 6ae15c71833..be484eab030 100755 --- a/source/blender/freestyle/intern/stroke/StrokeRep.cpp +++ b/source/blender/freestyle/intern/stroke/StrokeRep.cpp @@ -259,6 +259,7 @@ Strip::createStrip (const vector<StrokeVertex*>& iStrokeVertices) // the strip is most likely doing a U-turn, we can't compute the average vector. // We just continue and hope it's ok vPrev = v; + cerr << "Warning: problem in strip creation (the strip is most likely doing a U-turn).\n"; continue; } |