From ef11c4e8e744cbd64895f27a1f26636cc5c2b047 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Sat, 18 Jul 2009 18:33:07 +0000 Subject: Fixed a bug that the parameter panel did not correctly work when a new file was created or an existing file was loaded. --- .../freestyle/intern/app_blender/FRS_freestyle.cpp | 20 ++++++++++++-------- source/blender/src/buttons_scene.c | 3 --- source/blender/src/usiblender.c | 6 ++++++ 3 files changed, 18 insertions(+), 11 deletions(-) (limited to 'source') diff --git a/source/blender/freestyle/intern/app_blender/FRS_freestyle.cpp b/source/blender/freestyle/intern/app_blender/FRS_freestyle.cpp index c65d71452a7..34e6e31a177 100644 --- a/source/blender/freestyle/intern/app_blender/FRS_freestyle.cpp +++ b/source/blender/freestyle/intern/app_blender/FRS_freestyle.cpp @@ -83,17 +83,22 @@ extern "C" { controller = new Controller; view = new AppView; controller->setView(view); + + } else { + + delete panelConfig; + + } + + panelConfig = new FreestylePanelConfigurationData; - panelConfig = new FreestylePanelConfigurationData; - - default_module_path = pathconfig->getProjectDir() + Config::DIR_SEP + "style_modules" + Config::DIR_SEP + "contour.py"; - FRS_select_layer( (SceneRenderLayer*) BLI_findlink(&G.scene->r.layers, G.scene->r.actlay) ); + default_module_path = pathconfig->getProjectDir() + Config::DIR_SEP + "style_modules" + Config::DIR_SEP + "contour.py"; + FRS_select_layer( (SceneRenderLayer*) BLI_findlink(&G.scene->r.layers, G.scene->r.actlay) ); - freestyle_is_initialized = 1; - } + freestyle_is_initialized = 1; } - + void FRS_exit() { delete pathconfig; delete controller; @@ -252,7 +257,6 @@ extern "C" { cout << "# Freestyle" << endl; cout << "#===============================================================" << endl; - FRS_initialize(); init_view(re); init_camera(re); diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index f1e98653000..9d4ff9db960 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -3317,9 +3317,6 @@ static void render_panel_freestyle() StyleModuleConf* module_conf; int module_number, last_module_number; - // initialization - FRS_initialize(); - // block block = uiNewBlock(&curarea->uiblocks, "render_panel_freestyle", UI_EMBOSS, UI_HELV, curarea->win); uiNewPanelTabbed("Render", "Render"); diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index c889fad1caf..5cd369ea937 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -154,6 +154,8 @@ #include "GPU_extensions.h" #include "GPU_draw.h" +#include "FRS_freestyle.h" + /***/ /* define for setting colors in theme below */ @@ -603,6 +605,8 @@ void BIF_read_file(char *name) if (retval!=0) G.relbase_valid = 1; + FRS_initialize(); + undo_editmode_clear(); undo_imagepaint_clear(); BKE_reset_undo(); @@ -677,6 +681,8 @@ int BIF_read_homefile(int from_memory) init_userdef_file(); + FRS_initialize(); + undo_editmode_clear(); undo_imagepaint_clear(); BKE_reset_undo(); -- cgit v1.2.3