diff options
author | Maxime Curioni <maxime.curioni@gmail.com> | 2009-04-08 21:32:56 +0400 |
---|---|---|
committer | Maxime Curioni <maxime.curioni@gmail.com> | 2009-04-08 21:32:56 +0400 |
commit | 997624c7ddad836080e54d5b488169954bc77b35 (patch) | |
tree | da0fce8924de795d07bfcd24db6743270b416545 | |
parent | 5dd39e651703249252f9c461031205fc22c90fd2 (diff) |
Corrected crash when calculating number of available style modules
3 files changed, 17 insertions, 3 deletions
diff --git a/source/blender/freestyle/intern/app_blender/Controller.cpp b/source/blender/freestyle/intern/app_blender/Controller.cpp index f960b749ce6..ddb581438bd 100755 --- a/source/blender/freestyle/intern/app_blender/Controller.cpp +++ b/source/blender/freestyle/intern/app_blender/Controller.cpp @@ -632,6 +632,7 @@ void Controller::DrawStrokes() if(_ViewMap == 0) return; + cout << "\n=== Stroke drawing ===" << endl; _Chrono.start(); _Canvas->Draw(); real d = _Chrono.stop(); diff --git a/source/blender/freestyle/intern/app_blender/FRS_freestyle.cpp b/source/blender/freestyle/intern/app_blender/FRS_freestyle.cpp index 74414fbc844..95d0a5f7fa1 100644 --- a/source/blender/freestyle/intern/app_blender/FRS_freestyle.cpp +++ b/source/blender/freestyle/intern/app_blender/FRS_freestyle.cpp @@ -249,7 +249,7 @@ extern "C" { init_view(re); init_camera(re); - for(srl= (SceneRenderLayer *)re->scene->r.layers.first; srl; srl= srl->next) { + for(srl= (SceneRenderLayer *)G.scene->r.layers.first; srl; srl= srl->next) { if( !(srl->layflag & SCE_LAY_DISABLE) && srl->layflag & SCE_LAY_FRS && displayed_layer_count(srl) > 0 ) diff --git a/source/blender/freestyle/intern/stroke/StyleModule.h b/source/blender/freestyle/intern/stroke/StyleModule.h index 3d39e53515b..390a67d633d 100755 --- a/source/blender/freestyle/intern/stroke/StyleModule.h +++ b/source/blender/freestyle/intern/stroke/StyleModule.h @@ -61,12 +61,25 @@ public: cerr << "Error: no interpreter was found to execute the script" << endl; return NULL; } + + if (!_drawable) { + cerr << "Error: not drawable" << endl; + return NULL; + } + Operators::reset(); - if (_inter->interpretFile(_file_name)) + int errorCode; + if( errorCode = _inter->interpretFile(_file_name)) { + cerr << "Error: interpretation failed with code " << errorCode << endl; return NULL; + } + Operators::StrokesContainer* strokes_set = Operators::getStrokesSet(); - if (!_drawable || strokes_set->empty()) + if( strokes_set->empty() ) { + cerr << "Error: strokes set empty" << endl; return NULL; + } + StrokeLayer* sl = new StrokeLayer; for (Operators::StrokesContainer::iterator it = strokes_set->begin(); it != strokes_set->end(); |