[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15218] branches/soc-2008-mxcurioni/source /blender/freestyle/intern/app_blender: soc-2008-mxcurioni: removed static dependencies (formerly fixed in app_blender/test_config.h).
Maxime Curioni
maxime.curioni at gmail.com
Sat Jun 14 00:24:26 CEST 2008
Revision: 15218
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15218
Author: mxcurioni
Date: 2008-06-14 00:23:24 +0200 (Sat, 14 Jun 2008)
Log Message:
-----------
soc-2008-mxcurioni: removed static dependencies (formerly fixed in app_blender/test_config.h). From now on, to use the branch, one needs to define a FREESTYLE_BLENDER_DIR environment variable to point to the Freestyle directory source/blender/freestyle
Modified Paths:
--------------
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppConfig.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/api.cpp
Removed Paths:
-------------
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/test_config.h
Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppConfig.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppConfig.cpp 2008-06-13 21:24:21 UTC (rev 15217)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppConfig.cpp 2008-06-13 22:23:24 UTC (rev 15218)
@@ -18,8 +18,6 @@
//
///////////////////////////////////////////////////////////////////////////////
-#include "test_config.h"
-
#include "AppConfig.h"
#include <iostream>
@@ -34,10 +32,8 @@
_HomeDir = getEnvVar("HOME");
// get the root directory
//soc
- //setRootDir(getEnvVar("FREESTYLE_BLENDER_DIR"));
- setRootDir( TEST_ROOT_DIR );
+ setRootDir(getEnvVar("FREESTYLE_BLENDER_DIR"));
-//setRootDir(QString("."));
_pInstance = this;
}
void Path::setRootDir(const string& iRootDir){
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-06-13 21:24:21 UTC (rev 15217)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.cpp 2008-06-13 22:23:24 UTC (rev 15218)
@@ -64,8 +64,6 @@
#include "../system/StringUtils.h"
-#include "test_config.h"
-
Controller::Controller()
{
@@ -1062,7 +1060,7 @@
// Default init options
Config::Path * cpath = Config::Path::getInstance();
-
+
// Directories
ViewMapIO::Options::setModelsPath( StringUtils::toAscii( cpath->getModelsPath() ) );
PythonInterpreter::Options::setPythonPath( StringUtils::toAscii( cpath->getPythonPath() ) );
@@ -1079,8 +1077,8 @@
// Papers Textures
vector<string> sl;
- sl.push_back( StringUtils::toAscii( TEST_TEXTURE_FILE ) );
- TextureManager::Options::setPaperTextures(sl);
+ sl.push_back( StringUtils::toAscii( cpath->getPapersDir() + Config::DEFAULT_PAPER_TEXTURE ) );
+ TextureManager::Options::setPaperTextures( sl );
// Drawing Buffers
setFrontBufferFlag(false);
Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/api.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/api.cpp 2008-06-13 21:24:21 UTC (rev 15217)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/api.cpp 2008-06-13 22:23:24 UTC (rev 15218)
@@ -2,7 +2,6 @@
#include "AppGLWidget.h"
#include "Controller.h"
#include "AppConfig.h"
-#include "test_config.h"
#include <iostream>
@@ -28,9 +27,8 @@
static Controller *controller = NULL;
static AppGLWidget *view = NULL;
-
+
void FRS_initialize(){
- Config::Path pathconfig;
if( controller == NULL )
controller = new Controller;
@@ -40,7 +38,8 @@
}
void FRS_execute(Render* re) {
-
+
+ Config::Path pathconfig;
FRS_initialize();
controller->SetView(view);
@@ -51,12 +50,15 @@
view->_camera->setScreenWidthAndHeight(width, height);
//view->setCameraState(const float* position, const float* orientation)
- BPY_run_python_script( TEST_3DS_EXPORT );
+ string script_3ds_export = pathconfig.getProjectDir() +
+ Config::DIR_SEP + "python" +
+ Config::DIR_SEP + "3ds_export.py";
+ BPY_run_python_script( const_cast<char *>(script_3ds_export.c_str()) );
char btempdir[255];
BLI_where_is_temp(btempdir,1);
string exported_3ds_file = btempdir;
- exported_3ds_file += "/tmp_scene_freestyle.3ds";
+ exported_3ds_file += Config::DIR_SEP + "tmp_scene_freestyle.3ds";
if( BLI_exists( const_cast<char *>(exported_3ds_file.c_str()) ) ) {
controller->Load3DSFile( exported_3ds_file.c_str() );
}
@@ -65,7 +67,10 @@
return;
}
- controller->InsertStyleModule( 0, TEST_STYLE_MODULE_FILE );
+ string style_module = pathconfig.getProjectDir() +
+ Config::DIR_SEP + "style_modules" +
+ Config::DIR_SEP + "contour.py";
+ controller->InsertStyleModule( 0, const_cast<char *>(style_module.c_str()) );
controller->toggleLayer(0, true);
controller->ComputeViewMap();
Deleted: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/test_config.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/test_config.h 2008-06-13 21:24:21 UTC (rev 15217)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/test_config.h 2008-06-13 22:23:24 UTC (rev 15218)
@@ -1,10 +0,0 @@
-#define TEST_STYLE_MODULE_FILE "/Users/mx/Documents/work/GSoC_2008/bf-blender/branches/soc-2008-mxcurioni/source/blender/freestyle/style_modules/contour.py"
-
-#define TEST_ROOT_DIR "/Users/mx/Documents/work/GSoC_2008/bf-blender/branches/soc-2008-mxcurioni/source/blender/freestyle"
-
-#define TEST_TEXTURE_FILE "/Users/mx/Documents/work/GSoC_2008/bf-blender/branches/soc-2008-mxcurioni/source/blender/freestyle/data/textures/papers/whitepaper.jpg"
-
-
-
-
-#define TEST_3DS_EXPORT "/Users/mx/Documents/work/GSoC_2008/bf-blender/branches/soc-2008-mxcurioni/source/blender/freestyle/python/3ds_export.py"
More information about the Bf-blender-cvs
mailing list