Only initialize icons in background mode.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 15 May 2015 20:18:04 +0000 (06:18 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 15 May 2015 20:21:26 +0000 (06:21 +1000)
Also enable this for headless builds too.

Calling UI_icons_init would initialize matcaps, brushes etc...

source/blender/editors/interface/interface_icons.c
source/blender/windowmanager/intern/wm_init_exit.c

index 7c05d5f4378bbf7b86bcea84737edc488a1845b2..420af1e2e71d27a1104ea43f07ed74782abb38bb 100644 (file)
@@ -889,11 +889,9 @@ int UI_icon_get_height(int icon_id)
 
 void UI_icons_init(int first_dyn_id)
 {
-#ifdef WITH_HEADLESS
-       (void)first_dyn_id;
-#else
-       init_iconfile_list(&iconfilelist);
        BKE_icons_init(first_dyn_id);
+#ifndef WITH_HEADLESS
+       init_iconfile_list(&iconfilelist);
        init_internal_icons();
        init_brush_icons();
        init_matcap_icons();
index 8778929ae0828c21b6e644d269cfc2bbdb1a7fa9..c7544f213720e85f0d5668b6de21d6355606de72 100644 (file)
@@ -58,6 +58,7 @@
 #include "BKE_screen.h"
 #include "BKE_DerivedMesh.h"
 #include "BKE_global.h"
+#include "BKE_icons.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_mball_tessellate.h"
@@ -179,11 +180,17 @@ void WM_init(bContext *C, int argc, const char **argv)
                GPU_set_linear_mipmap(true);
                GPU_set_anisotropic(U.anisotropic_filter);
                GPU_set_gpu_mipmapping(U.use_gpu_mipmap);
+
+               UI_init();
+       }
+       else {
+               /* Note: Currently only inits icons, which we now want in background mode too
+                * (scripts could use those in background processing...).
+                * In case we do more later, we may need to pass a 'background' flag.
+                * Called from 'UI_init' above */
+               BKE_icons_init(1);
        }
 
-       /* Note: Currently only inits icons, which we now want in background mode too (scripts could use those in background
-        *       processing...). In case we do more later, we may need to pass a 'background' flag. */
-       UI_init();
 
        ED_spacemacros_init();