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-07-31 15:20:30 +0400
committerMaxime Curioni <maxime.curioni@gmail.com>2008-07-31 15:20:30 +0400
commitf09f89d5dcbc5532eeda9f54f0e1163373491083 (patch)
tree9cf112e13a5e1728be82c199b5a32f5e7922de54 /source/blender/freestyle/intern
parent3010f2b753f2397256861816504b8e7d697632db (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/intern')
-rw-r--r--source/blender/freestyle/intern/app_blender/api.cpp17
1 files changed, 11 insertions, 6 deletions
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