Revision: 19604
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19604
Author:   mxcurioni
Date:     2009-04-08 19:32:56 +0200 (Wed, 08 Apr 2009)

Log Message:
-----------
Corrected crash when calculating number of available style modules

Modified Paths:
--------------
    
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.cpp
    
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/FRS_freestyle.cpp
    
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/StyleModule.h

Modified: 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.cpp
===================================================================
--- 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.cpp
      2009-04-08 16:57:08 UTC (rev 19603)
+++ 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.cpp
      2009-04-08 17:32:56 UTC (rev 19604)
@@ -632,6 +632,7 @@
   if(_ViewMap == 0)
     return;
 
+  cout << "\n===  Stroke drawing  ===" << endl;
   _Chrono.start();
   _Canvas->Draw();
   real d = _Chrono.stop();

Modified: 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/FRS_freestyle.cpp
===================================================================
--- 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/FRS_freestyle.cpp
   2009-04-08 16:57:08 UTC (rev 19603)
+++ 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/FRS_freestyle.cpp
   2009-04-08 17:32:56 UTC (rev 19604)
@@ -249,7 +249,7 @@
                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       )

Modified: 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/StyleModule.h
===================================================================
--- 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/StyleModule.h
    2009-04-08 16:57:08 UTC (rev 19603)
+++ 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/StyleModule.h
    2009-04-08 17:32:56 UTC (rev 19604)
@@ -61,12 +61,25 @@
       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();


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to