[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15008] branches/soc-2008-mxcurioni/source /blender/freestyle: soc-2008-mxcurioni: Freestyle execution now works flawlessly ( Python runtime loads appropriate modules, using SWIG wrapper), but does not render anything yet ( render window OpenGL context not used yet).
Maxime Curioni
maxime.curioni at gmail.com
Tue May 27 16:13:16 CEST 2008
Revision: 15008
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15008
Author: mxcurioni
Date: 2008-05-27 16:13:16 +0200 (Tue, 27 May 2008)
Log Message:
-----------
soc-2008-mxcurioni: Freestyle execution now works flawlessly (Python runtime loads appropriate modules, using SWIG wrapper), but does not render anything yet (render window OpenGL context not used yet). Currently, the SWIG wrapper library needs to be manually compiled (see SWIG section in source/blender/freestyle/SConscript for details). I am missing some knowledge on scons to create it automatically from the SConscript. Once I find that information, I'll make it automatic and for different platforms.
I also corrected a simple GLStrokeRenderer bug for texture loading (not in original Freestyle code). Apparently, IMB_loadiffname doesn't recognize the paper's texture depth so a work-around will have to be found.
Modified Paths:
--------------
branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLStrokeRenderer.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/PythonInterpreter.h
Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript 2008-05-27 13:33:24 UTC (rev 15007)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript 2008-05-27 14:13:16 UTC (rev 15008)
@@ -77,19 +77,6 @@
########################################################
# swig
-# swig -c++ -python -o ModuleWrapper.cpp Freestyle.i
-#
-# g++ -w -I../geometry -I../image -I../scene_graph -I../stroke -I../system -I../view_map -I../winged_edge -I/usr/include/python2.5 -c ModuleWrapper.cpp -o ModuleWrapper.o
-#
-# install -d ../../build/macosx/release/lib/python
-#
-# g++ -bundle -flat_namespace -undefined suppress -w -L/usr/lib/python2.5/config -lpython2.5 -o ../../build/macosx/release/lib/python/_Freestyle.so ModuleWrapper.o
-#
-# install Freestyle.py ../../build/macosx/release/lib/python
-
-
-#================ MINE
-
# g++ -w -I../geometry -I../image -I../scene_graph -I../stroke -I../system -I../view_map -I../winged_edge -I/usr/include/python2.5 -I../../../blenlib -I../../../blenkernel -I../../../imbuf -I../../../makesdna -c ModuleWrapper.cpp -o ModuleWrapper.o
-#
-# g++ -bundle -flat_namespace -undefined suppress -w -L/Users/mx/Documents/work/GSoC_2008/bf-blender/branches/build/darwin/lib -L/usr/lib/python2.5/config -lbf_freestyle -lbf_blenlib -lbf_blenkernel -lbf_guardedalloc -lbf_imbuf -lpython2.5 -o ../../python/_Freestyle.so ModuleWrapper.o
+
+# g++ -bundle -flat_namespace -undefined suppress -w -L/usr/lib/python2.5/config -L/Users/mx/Documents/work/GSoC_2008/bf-blender/branches/build/darwin/lib -lpython2.5 -lbf_freestyle -o ../../python/_Freestyle.so ModuleWrapper.o
\ No newline at end of file
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 2008-05-27 13:33:24 UTC (rev 15007)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.cpp 2008-05-27 14:13:16 UTC (rev 15008)
@@ -1098,7 +1098,6 @@
setFrontBufferFlag(false);
setBackBufferFlag(true);
-
// Ridges and Valleys
setComputeRidgesAndValleysFlag( false );
@@ -1107,4 +1106,6 @@
setSphereRadius(1);
setSuggestiveContourKrDerivativeEpsilon(0);
+ // soc: initialize canvas
+ _Canvas->init();
}
Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLStrokeRenderer.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLStrokeRenderer.cpp 2008-05-27 13:33:24 UTC (rev 15007)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLStrokeRenderer.cpp 2008-05-27 14:13:16 UTC (rev 15008)
@@ -291,8 +291,10 @@
// Papers textures
cout << "Loading papers textures..." << endl;
- for (unsigned i = 0; i < size; i++)
- preparePaper(_papertextures[i].c_str(), _papertexname[i]);
+ for (unsigned i = 0; i < size; i++){
+ cout << i << ": " << _papertextures[i] << endl;
+ preparePaper(_papertextures[i].c_str(), _papertexname[i]);
+ }
cout << "Done." << endl << endl;
}
@@ -368,12 +370,12 @@
//soc if (qim.isNull())
if( qim )
{
- cerr << " Error: unable to read \"" << name << "\"" << endl;
+ cerr << " Error: unable to read \"" << filename << "\"" << endl;
return false;
}
if( qim->depth > 8) //soc
{
- cerr<<" Error: \""<< name <<"\" has "<< qim->depth <<" bits/pixel"<<endl; //soc
+ cerr<<" Error: \""<< filename <<"\" has "<< qim->depth <<" bits/pixel"<<endl; //soc
return false;
}
// qim=QGLWidget::convertToGLFormat( qimOri );
@@ -414,14 +416,14 @@
char filename[FILE_MAXFILE];
BLI_splitdirstring(name, filename);
- if (qim) //soc
+ if (!qim) //soc
{
- cerr << " Error: unable to read \"" << name << "\"" << endl;
+ cerr << " Error: unable to read \"" << filename << "\"" << endl;
return false;
}
if (qim->depth > 8) //soc
{
- cerr<<" Error: \""<<name<<"\" has "<<qim->depth <<" bits/pixel"<<endl;//soc
+ cerr<<" Error: \""<<filename<<"\" has "<<qim->depth <<" bits/pixel"<<endl;//soc
return false;
}
@@ -461,14 +463,14 @@
char filename[FILE_MAXFILE];
BLI_splitdirstring(name, filename);
- if (qim) //soc
+ if (!qim) //soc
{
- cerr << " Error: unable to read \"" << name << "\"" << endl;
+ cerr << " Error: unable to read \"" << filename << "\"" << endl;
return false;
}
if (qim->depth > 8) //soc
{
- cerr<<" Error: \""<<name<<"\" has "<<qim->depth<<" bits/pixel"<<endl; //soc
+ cerr<<" Error: \""<<filename<<"\" has "<< qim->depth <<" bits/pixel"<<endl; //soc
return false;
}
@@ -507,14 +509,15 @@
char filename[FILE_MAXFILE];
BLI_splitdirstring((char *)name, filename);
- if (qim) //soc
+ if (!qim) //soc
{
- cerr << " Error: unable to read \"" << name << "\"" << endl;
+ cerr << " Error: unable to read \"" << filename << "\"" << endl;
return false;
}
+
if (qim->depth !=32) //soc
{
- cerr<<" Error: \""<<name<<"\" has "<<qim->depth<<" bits/pixel"<<endl; //soc
+ cerr<<" Error: \""<<filename<<"\" has "<<qim->depth<<" bits/pixel"<<endl; //soc
return false;
}
//soc QImage qim2=QGLWidget::convertToGLFormat( qim );
Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/PythonInterpreter.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/PythonInterpreter.h 2008-05-27 13:33:24 UTC (rev 15007)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/PythonInterpreter.h 2008-05-27 14:13:16 UTC (rev 15008)
@@ -108,7 +108,7 @@
vector<string> pathnames;
StringUtils::getPathName(_path, "", pathnames);
- struct Text *text = add_empty_text("initpath_test.txt");
+ struct Text *text = add_empty_text("tmp_initpath.txt");
string cmd = "import sys\n";
txt_insert_buf(text, const_cast<char*>(cmd.c_str()));
More information about the Bf-blender-cvs
mailing list