[Bf-blender-cvs] [310e396b516] blender2.8: Cleanup: remove unused Blender Internal preview.blend.
Brecht Van Lommel
noreply at git.blender.org
Thu Sep 6 17:17:41 CEST 2018
Commit: 310e396b516f25530ca4f9883a73628de59267b4
Author: Brecht Van Lommel
Date: Thu Sep 6 17:16:11 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB310e396b516f25530ca4f9883a73628de59267b4
Cleanup: remove unused Blender Internal preview.blend.
===================================================================
D release/datafiles/preview.blend
M source/blender/editors/datafiles/CMakeLists.txt
M source/blender/editors/include/ED_datafiles.h
M source/blender/editors/render/render_preview.c
===================================================================
diff --git a/release/datafiles/preview.blend b/release/datafiles/preview.blend
deleted file mode 100644
index 7e30e2dcf00..00000000000
Binary files a/release/datafiles/preview.blend and /dev/null differ
diff --git a/source/blender/editors/datafiles/CMakeLists.txt b/source/blender/editors/datafiles/CMakeLists.txt
index 4c735634b3f..aa764535349 100644
--- a/source/blender/editors/datafiles/CMakeLists.txt
+++ b/source/blender/editors/datafiles/CMakeLists.txt
@@ -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)
diff --git a/source/blender/editors/include/ED_datafiles.h b/source/blender/editors/include/ED_datafiles.h
index 333e3d72615..c21ef288aeb 100644
--- a/source/blender/editors/include/ED_datafiles.h
+++ b/source/blender/editors/include/ED_datafiles.h
@@ -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[];
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index 7253f07fea4..6d3e6431afb 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -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);
More information about the Bf-blender-cvs
mailing list