diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-06-11 06:32:01 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-06-11 06:32:01 +0400 |
commit | 5520331215ffec52cd518f30bdf6e6276840e290 (patch) | |
tree | 77a5df7b902cb05a3780dd0aff46f851d514c45c /source/blender/freestyle/intern/application | |
parent | 9020df976ca37104a36a90d43c6e5b33c24cdbd2 (diff) |
Fix #35561: freestyle + read full sample layers = crash.
Now add_freestyle() in pipeline.c takes a second argument to enable/disable
stroke rendering. When stroke rendering is disabled, the function allocates
data structures but does not perform stroke rendering. The allocated data
structures (mostly left unpopulated with data elements) are intended to allow
for the Read Full Sample Layers (Shift-R) command in the compositor.
Diffstat (limited to 'source/blender/freestyle/intern/application')
-rw-r--r-- | source/blender/freestyle/intern/application/Controller.cpp | 7 | ||||
-rw-r--r-- | source/blender/freestyle/intern/application/Controller.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/freestyle/intern/application/Controller.cpp b/source/blender/freestyle/intern/application/Controller.cpp index 436cdbfe6b5..dbf3fa8349e 100644 --- a/source/blender/freestyle/intern/application/Controller.cpp +++ b/source/blender/freestyle/intern/application/Controller.cpp @@ -833,17 +833,18 @@ void Controller::ResetRenderCount() _render_count = 0; } -Render *Controller::RenderStrokes(Render *re) +Render *Controller::RenderStrokes(Render *re, bool render) { _Chrono.start(); BlenderStrokeRenderer *blenderRenderer = new BlenderStrokeRenderer(re, ++_render_count); - _Canvas->Render(blenderRenderer); + if (render) + _Canvas->Render(blenderRenderer); real d = _Chrono.stop(); if (G.debug & G_DEBUG_FREESTYLE) { cout << "Temporary scene generation: " << d << endl; } _Chrono.start(); - Render *freestyle_render = blenderRenderer->RenderScene(re); + Render *freestyle_render = blenderRenderer->RenderScene(re, render); d = _Chrono.stop(); if (G.debug & G_DEBUG_FREESTYLE) { cout << "Stroke rendering : " << d << endl; diff --git a/source/blender/freestyle/intern/application/Controller.h b/source/blender/freestyle/intern/application/Controller.h index 3315fe7e20b..c8eaaf5486b 100644 --- a/source/blender/freestyle/intern/application/Controller.h +++ b/source/blender/freestyle/intern/application/Controller.h @@ -86,7 +86,7 @@ public: void toggleEdgeTesselationNature(Nature::EdgeNature iNature); void DrawStrokes(); void ResetRenderCount(); - Render *RenderStrokes(Render *re); + Render *RenderStrokes(Render *re, bool render); void SwapStyleModules(unsigned i1, unsigned i2); void InsertStyleModule(unsigned index, const char *iFileName); void InsertStyleModule(unsigned index, const char *iName, struct Text *iText); |