diff options
author | Maxime Curioni <maxime.curioni@gmail.com> | 2008-07-31 15:20:30 +0400 |
---|---|---|
committer | Maxime Curioni <maxime.curioni@gmail.com> | 2008-07-31 15:20:30 +0400 |
commit | f09f89d5dcbc5532eeda9f54f0e1163373491083 (patch) | |
tree | 9cf112e13a5e1728be82c199b5a32f5e7922de54 /source/blender/freestyle | |
parent | 3010f2b753f2397256861816504b8e7d697632db (diff) |
soc-2008-mxcurioni: added a Freestyle panel to select a style at run-time, by specifying its pathname. By default, it is loaded with the contour.py path.
Diffstat (limited to 'source/blender/freestyle')
-rw-r--r-- | source/blender/freestyle/FRS_freestyle.h | 3 | ||||
-rw-r--r-- | source/blender/freestyle/intern/app_blender/api.cpp | 17 |
2 files changed, 14 insertions, 6 deletions
diff --git a/source/blender/freestyle/FRS_freestyle.h b/source/blender/freestyle/FRS_freestyle.h index 060ccf6961a..20ff6b72231 100644 --- a/source/blender/freestyle/FRS_freestyle.h +++ b/source/blender/freestyle/FRS_freestyle.h @@ -5,6 +5,9 @@ extern "C" { #endif + extern char style_module[255]; + + void FRS_initialize(); void FRS_prepare(Render* re); void FRS_execute(Render* re, int render_in_layer); diff --git a/source/blender/freestyle/intern/app_blender/api.cpp b/source/blender/freestyle/intern/app_blender/api.cpp index 7f5135a2655..a6490324fbf 100644 --- a/source/blender/freestyle/intern/app_blender/api.cpp +++ b/source/blender/freestyle/intern/app_blender/api.cpp @@ -30,7 +30,8 @@ extern "C" { static Controller *controller = NULL; static AppGLWidget *view = NULL; - + char style_module[255] = ""; + void FRS_initialize(){ if( pathconfig == NULL ) @@ -42,8 +43,14 @@ extern "C" { if( view == NULL ) view = new AppGLWidget; - controller->Clear(); controller->setView(view); + controller->Clear(); + + if( strlen(style_module) == 0 ){ + string path( pathconfig->getProjectDir() + Config::DIR_SEP + "style_modules_blender" + Config::DIR_SEP + "contour.py" ); + strcpy( style_module, path.c_str() ); + } + } @@ -114,10 +121,8 @@ extern "C" { } // add style module - string style_module = pathconfig->getProjectDir() + - Config::DIR_SEP + "style_modules_blender" + - Config::DIR_SEP + "contour.py"; - controller->InsertStyleModule( 0, const_cast<char *>(style_module.c_str()) ); + cout << "Module: " << style_module << endl; + controller->InsertStyleModule( 0, style_module ); controller->toggleLayer(0, true); // compute view map |