diff options
-rw-r--r-- | source/blender/editors/render/render_preview.c | 9 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_render.c | 4 | ||||
-rw-r--r-- | source/blender/render/extern/include/RE_engine.h | 1 |
3 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 70c9e3c4306..450a3b19889 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -88,6 +88,7 @@ #include "PIL_time.h" #include "RE_pipeline.h" +#include "RE_engine.h" #include "WM_api.h" #include "WM_types.h" @@ -213,6 +214,12 @@ void ED_preview_init_dbase(void) #endif } +static bool check_engine_supports_textures(Scene *scene) +{ + RenderEngineType *type = RE_engines_find(scene->r.engine); + return type->flag & RE_USE_TEXTURE_PREVIEW; +} + void ED_preview_free_dbase(void) { if (G_pr_main) @@ -299,7 +306,7 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre sce->r.cfra = scene->r.cfra; - if (id_type == ID_TE) { + if (id_type == ID_TE && !check_engine_supports_textures(scene)) { /* Force blender internal for texture icons and nodes render, * seems commonly used render engines does not support * such kind of rendering. diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index b1f997a5f80..0ee654d4ecc 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -587,6 +587,10 @@ static void rna_def_render_engine(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_PREVIEW); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); + prop = RNA_def_property(srna, "bl_use_texture_preview", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_TEXTURE_PREVIEW); + RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); + prop = RNA_def_property(srna, "bl_use_postprocess", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "type->flag", RE_USE_POSTPROCESS); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); diff --git a/source/blender/render/extern/include/RE_engine.h b/source/blender/render/extern/include/RE_engine.h index 24f8cbee401..4b0473f7483 100644 --- a/source/blender/render/extern/include/RE_engine.h +++ b/source/blender/render/extern/include/RE_engine.h @@ -60,6 +60,7 @@ struct BakePixel; #define RE_USE_SHADING_NODES 16 #define RE_USE_EXCLUDE_LAYERS 32 #define RE_USE_SAVE_BUFFERS 64 +#define RE_USE_TEXTURE_PREVIEW 128 /* RenderEngine.flag */ #define RE_ENGINE_ANIMATION 1 |