From d8171e4bc6c25200661542ad9a42e8e41bb748c4 Mon Sep 17 00:00:00 2001 From: Maxime Curioni Date: Fri, 13 Jun 2008 22:23:24 +0000 Subject: 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 --- .../freestyle/intern/app_blender/AppConfig.cpp | 6 +----- .../freestyle/intern/app_blender/Controller.cpp | 8 +++----- source/blender/freestyle/intern/app_blender/api.cpp | 19 ++++++++++++------- .../freestyle/intern/app_blender/test_config.h | 10 ---------- 4 files changed, 16 insertions(+), 27 deletions(-) delete mode 100644 source/blender/freestyle/intern/app_blender/test_config.h (limited to 'source/blender/freestyle/intern/app_blender') diff --git a/source/blender/freestyle/intern/app_blender/AppConfig.cpp b/source/blender/freestyle/intern/app_blender/AppConfig.cpp index a2fa8787fa9..37d139f54e3 100755 --- a/source/blender/freestyle/intern/app_blender/AppConfig.cpp +++ b/source/blender/freestyle/intern/app_blender/AppConfig.cpp @@ -18,8 +18,6 @@ // /////////////////////////////////////////////////////////////////////////////// -#include "test_config.h" - #include "AppConfig.h" #include @@ -34,10 +32,8 @@ namespace Config{ _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){ diff --git a/source/blender/freestyle/intern/app_blender/Controller.cpp b/source/blender/freestyle/intern/app_blender/Controller.cpp index 8b494ff5108..9abf082d5cc 100755 --- a/source/blender/freestyle/intern/app_blender/Controller.cpp +++ b/source/blender/freestyle/intern/app_blender/Controller.cpp @@ -64,8 +64,6 @@ #include "../system/StringUtils.h" -#include "test_config.h" - Controller::Controller() { @@ -1062,7 +1060,7 @@ void Controller::init_options(){ // 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 @@ void Controller::init_options(){ // Papers Textures vector 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); diff --git a/source/blender/freestyle/intern/app_blender/api.cpp b/source/blender/freestyle/intern/app_blender/api.cpp index c097b64ef53..2a7868304ea 100644 --- a/source/blender/freestyle/intern/app_blender/api.cpp +++ b/source/blender/freestyle/intern/app_blender/api.cpp @@ -2,7 +2,6 @@ #include "AppGLWidget.h" #include "Controller.h" #include "AppConfig.h" -#include "test_config.h" #include @@ -28,9 +27,8 @@ extern "C" { static Controller *controller = NULL; static AppGLWidget *view = NULL; - + void FRS_initialize(){ - Config::Path pathconfig; if( controller == NULL ) controller = new Controller; @@ -40,7 +38,8 @@ extern "C" { } void FRS_execute(Render* re) { - + + Config::Path pathconfig; FRS_initialize(); controller->SetView(view); @@ -51,12 +50,15 @@ extern "C" { 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(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(exported_3ds_file.c_str()) ) ) { controller->Load3DSFile( exported_3ds_file.c_str() ); } @@ -65,7 +67,10 @@ extern "C" { 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(style_module.c_str()) ); controller->toggleLayer(0, true); controller->ComputeViewMap(); diff --git a/source/blender/freestyle/intern/app_blender/test_config.h b/source/blender/freestyle/intern/app_blender/test_config.h deleted file mode 100644 index c2337c0ba4c..00000000000 --- a/source/blender/freestyle/intern/app_blender/test_config.h +++ /dev/null @@ -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" -- cgit v1.2.3