Cleanup: remove unused Blender Internal preview.blend.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 6 Sep 2018 15:16:11 +0000 (17:16 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 6 Sep 2018 15:16:11 +0000 (17:16 +0200)
release/datafiles/preview.blend [deleted file]
source/blender/editors/datafiles/CMakeLists.txt
source/blender/editors/include/ED_datafiles.h
source/blender/editors/render/render_preview.c

diff --git a/release/datafiles/preview.blend b/release/datafiles/preview.blend
deleted file mode 100644 (file)
index 7e30e2d..0000000
Binary files a/release/datafiles/preview.blend and /dev/null differ
index 4c735634b3f8268228ce415d04b0c23d5ddcdddc..aa76453534915ed8c35517ee176fafe9261d0a65 100644 (file)
@@ -674,7 +674,6 @@ if(WITH_BLENDER)
                # blender UI only
 
                # blends
-               data_to_c_simple(../../../../release/datafiles/preview.blend SRC)
                data_to_c_simple(../../../../release/datafiles/preview_cycles.blend SRC)
                data_to_c_simple(../../../../release/datafiles/preview_grease_pencil.blend SRC)
 
index 333e3d726155165e0dc9ab3067610d19159cbb39..c21ef288aebb54b58f4ddc79fa85ca4bfb400c25 100644 (file)
@@ -36,9 +36,6 @@
 extern int datatoc_startup_blend_size;
 extern char datatoc_startup_blend[];
 
-extern int datatoc_preview_blend_size;
-extern char datatoc_preview_blend[];
-
 extern int datatoc_preview_cycles_blend_size;
 extern char datatoc_preview_cycles_blend[];
 
index 7253f07fea4f601e87e6a051771a39c77681a899..6d3e6431afb0469793af5c3c62c7abd15a61d32b 100644 (file)
@@ -197,7 +197,6 @@ typedef struct IconPreview {
 
 /* *************************** Preview for buttons *********************** */
 
-static Main *G_pr_main = NULL;
 static Main *G_pr_main_cycles = NULL;
 static Main *G_pr_main_grease_pencil = NULL;
 
@@ -227,7 +226,6 @@ void ED_preview_ensure_dbase(void)
        static bool base_initialized = false;
        BLI_assert(BLI_thread_is_main());
        if (!base_initialized) {
-               G_pr_main = load_main_from_memory(datatoc_preview_blend, datatoc_preview_blend_size);
                G_pr_main_cycles = load_main_from_memory(datatoc_preview_cycles_blend, datatoc_preview_cycles_blend_size);
                G_pr_main_grease_pencil = load_main_from_memory(datatoc_preview_grease_pencil_blend, datatoc_preview_grease_pencil_blend_size);
                base_initialized = true;
@@ -249,9 +247,6 @@ static bool check_engine_supports_preview(Scene *scene)
 
 void ED_preview_free_dbase(void)
 {
-       if (G_pr_main)
-               BKE_main_free(G_pr_main);
-
        if (G_pr_main_cycles)
                BKE_main_free(G_pr_main_cycles);
 
@@ -1184,25 +1179,17 @@ static void icon_preview_startjob_all_sizes(void *customdata, short *stop, short
 
                if (is_render) {
                        BLI_assert(ip->id);
-                       /* texture icon rendering is hardcoded to use the BI scene,
-                        * so don't even think of using cycle's bmain for
-                        * texture icons
-                        */
-                       if (GS(ip->id->name) != ID_TE) {
-                               /* grease pencil use its own preview file */
-                               if (GS(ip->id->name) == ID_MA) {
-                                       ma = (Material *)ip->id;
-                               }
 
-                               if ((ma == NULL) || (ma->gp_style == NULL)) {
-                                       sp->pr_main = G_pr_main_cycles;
-                               }
-                               else {
-                                       sp->pr_main = G_pr_main_grease_pencil;
-                               }
+                       /* grease pencil use its own preview file */
+                       if (GS(ip->id->name) == ID_MA) {
+                               ma = (Material *)ip->id;
+                       }
+
+                       if ((ma == NULL) || (ma->gp_style == NULL)) {
+                               sp->pr_main = G_pr_main_cycles;
                        }
                        else {
-                               sp->pr_main = G_pr_main;
+                               sp->pr_main = G_pr_main_grease_pencil;
                        }
                }
 
@@ -1373,22 +1360,17 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M
 
        /* hardcoded preview .blend for Eevee + Cycles, this should be solved
         * once with custom preview .blend path for external engines */
-       if ((method != PR_NODE_RENDER) && id_type != ID_TE) {
-               /* grease pencil use its own preview file */
-               if (GS(id->name) == ID_MA) {
-                       ma = (Material *)id;
-               }
 
-               if ((ma == NULL) || (ma->gp_style == NULL)) {
-                       sp->pr_main = G_pr_main_cycles;
-               }
-               else {
-                       sp->pr_main = G_pr_main_grease_pencil;
-               }
+       /* grease pencil use its own preview file */
+       if (GS(id->name) == ID_MA) {
+               ma = (Material *)id;
+       }
 
+       if ((ma == NULL) || (ma->gp_style == NULL)) {
+               sp->pr_main = G_pr_main_cycles;
        }
        else {
-               sp->pr_main = G_pr_main;
+               sp->pr_main = G_pr_main_grease_pencil;
        }
 
        if (ob && ob->totcol) copy_v4_v4(sp->col, ob->col);