Removed a Freestyle-specific function call from bf_windowmanager.
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sat, 23 Mar 2013 21:38:35 +0000 (21:38 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sat, 23 Mar 2013 21:38:35 +0000 (21:38 +0000)
Suggested by Sergey Sharybin through a code review of the branch.

source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
source/blender/windowmanager/CMakeLists.txt
source/blender/windowmanager/SConscript
source/blender/windowmanager/intern/wm_files.c

index 16f6633f54cd744f0f7511808c00d6733f63c243..50547c00dd460555b62cf8ebaf5c79023509ac88 100644 (file)
@@ -58,6 +58,7 @@ extern "C" {
 
 #include "BLI_blenlib.h"
 #include "BLI_math.h"
+#include "BLI_callbacks.h"
 
 #include "BPY_extern.h"
 
@@ -90,6 +91,18 @@ Scene *freestyle_scene;
 
 static string default_module_path;
 
+static void load_post_callback(struct Main *main, struct ID *id, void *arg)
+{
+       lineset_copied = false;
+}
+
+static bCallbackFuncStore load_post_callback_funcstore = {
+       NULL, NULL, /* next, prev */
+       load_post_callback, /* func */
+       NULL, /* arg */
+       0 /* alloc */
+};
+
 //=======================================================
 //   Initialization 
 //=======================================================
@@ -110,6 +123,8 @@ void FRS_initialize()
        default_module_path = pathconfig->getProjectDir() + Config::DIR_SEP + "style_modules" +
                              Config::DIR_SEP + "contour.py";
 
+       BLI_callback_add(&load_post_callback_funcstore, BLI_CB_EVT_LOAD_POST);
+
        freestyle_is_initialized = 1;
 }
 
@@ -121,11 +136,6 @@ void FRS_set_context(bContext *C)
        controller->setContext(C);
 }
 
-void FRS_read_file(bContext *C)
-{
-       lineset_copied = false;
-}
-
 void FRS_exit()
 {
        delete pathconfig;
index 8ec61a62d4926c537fd9c92cdb787934bda48227..65a8945f82bd6996e07c2fae88090827268dbd4f 100644 (file)
@@ -87,13 +87,6 @@ if(WITH_INTERNATIONAL)
        add_definitions(-DWITH_INTERNATIONAL)
 endif()
 
-if(WITH_FREESTYLE)
-       list(APPEND INC
-               ../freestyle
-       )
-       add_definitions(-DWITH_FREESTYLE)
-endif()
-
 if(WITH_OPENCOLLADA)
        add_definitions(-DWITH_COLLADA)
 endif()
index 5904a417190ae14c1b1075d2b8c9cf9249bb7d68..6db0e142ac491d47c836f35735bbfb811053ea87 100644 (file)
@@ -69,10 +69,6 @@ if env['BF_BUILDINFO']:
 if env['WITH_BF_INTERNATIONAL']:
     defs.append('WITH_INTERNATIONAL')
 
-if env['WITH_BF_FREESTYLE']:
-    incs += ' ../freestyle'
-    defs.append('WITH_FREESTYLE')
-
 if env['WITH_BF_COMPOSITOR']:
     defs.append("WITH_COMPOSITOR")
 
index c682165eb698fdeb37addb8879b30d49e7144031..66f6dc7de928658ec74fac20d89b4044ce8ee80c 100644 (file)
 #include "BPY_extern.h"
 #endif
 
-#ifdef WITH_FREESTYLE
-#  include "FRS_freestyle.h"
-#endif
-
 #include "WM_api.h"
 #include "WM_types.h"
 #include "wm.h"
@@ -438,9 +434,6 @@ void WM_file_read(bContext *C, const char *filepath, ReportList *reports)
                BPY_app_handlers_reset(FALSE);
                BPY_modules_load_user(C);
 #endif
-#ifdef WITH_FREESTYLE
-               FRS_read_file(C);
-#endif
 
                /* important to do before NULL'ing the context */
                BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);