Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Curioni <maxime.curioni@gmail.com>2008-06-14 02:23:24 +0400
committerMaxime Curioni <maxime.curioni@gmail.com>2008-06-14 02:23:24 +0400
commitd8171e4bc6c25200661542ad9a42e8e41bb748c4 (patch)
treea6113af64607ba81f75329664dad3305f3587365 /source/blender/freestyle/intern/app_blender
parent07001e708ed59e69871e8b4b096106981d9e6cd7 (diff)
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
Diffstat (limited to 'source/blender/freestyle/intern/app_blender')
-rwxr-xr-xsource/blender/freestyle/intern/app_blender/AppConfig.cpp6
-rwxr-xr-xsource/blender/freestyle/intern/app_blender/Controller.cpp8
-rw-r--r--source/blender/freestyle/intern/app_blender/api.cpp19
-rw-r--r--source/blender/freestyle/intern/app_blender/test_config.h10
4 files changed, 16 insertions, 27 deletions
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 <iostream>
@@ -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<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);
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 <iostream>
@@ -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<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 @@ 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<char *>(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"