diff options
author | Maxime Curioni <maxime.curioni@gmail.com> | 2008-08-02 11:39:49 +0400 |
---|---|---|
committer | Maxime Curioni <maxime.curioni@gmail.com> | 2008-08-02 11:39:49 +0400 |
commit | e385d69580de32df6dcfd009853ddd4eb8a3191e (patch) | |
tree | ef141019b1e00f03da689be0cea0b1a1bf6eb457 /source/blender/freestyle/intern/stroke/Operators.cpp | |
parent | 7565990db264dbb7771744cea0a1c87b3e11fc3f (diff) |
soc-2008-mxcurioni: Made crucial corrections to stabilize the system. Most of the original styles are supported: stroke attributes are correctly taken into account, Python shaders are supported. Added SamplingShader.
Diffstat (limited to 'source/blender/freestyle/intern/stroke/Operators.cpp')
-rwxr-xr-x | source/blender/freestyle/intern/stroke/Operators.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/freestyle/intern/stroke/Operators.cpp b/source/blender/freestyle/intern/stroke/Operators.cpp index 39914cbef1a..6221f6c16f1 100755 --- a/source/blender/freestyle/intern/stroke/Operators.cpp +++ b/source/blender/freestyle/intern/stroke/Operators.cpp @@ -814,10 +814,14 @@ Stroke* createStroke(Interface1D& inter) { inline void applyShading(Stroke& stroke, vector<StrokeShader*>& shaders) { - for (vector<StrokeShader*>::iterator it = shaders.begin(); - it != shaders.end(); - ++it) - (*it)->shade(stroke); + for (vector<StrokeShader*>::iterator it = shaders.begin(); it != shaders.end(); ++it) { + StrokeShader *ss = *it; + string name( ss->py_ss ? PyString_AsString(PyObject_CallMethod(ss->py_ss, "getName", "")) : ss->getName() ); + + cout << "Shading: " << name << endl; + (*it)->shade(stroke); + + } } @@ -832,7 +836,8 @@ void Operators::create(UnaryPredicate1D& pred, vector<StrokeShader*> shaders) { ++it) { if (!pred(**it)) continue; - Stroke* stroke = createStroke(**it); + + Stroke* stroke = createStroke(**it); if (stroke) { applyShading(*stroke, shaders); canvas->RenderStroke(stroke); |