Enable texture preview even when Cycles is active
This commit is contained in:
@@ -227,7 +227,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel):
|
||||
|
||||
class TEXTURE_PT_preview(TextureButtonsPanel, Panel):
|
||||
bl_label = "Preview"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'CYCLES'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
@@ -299,7 +299,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 && ELEM(sp->pr_method, PR_ICON_RENDER, PR_NODE_RENDER)) {
|
||||
if (id_type == ID_TE) {
|
||||
/* Force blender internal for texture icons and nodes render,
|
||||
* seems commonly used render engines does not support
|
||||
* such kind of rendering.
|
||||
@@ -1137,6 +1137,7 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M
|
||||
wmJob *wm_job;
|
||||
ShaderPreview *sp;
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
short id_type = GS(id->name);
|
||||
|
||||
wm_job = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner, "Shader Preview",
|
||||
WM_JOB_EXCL_RENDER, WM_JOB_TYPE_RENDER_PREVIEW);
|
||||
@@ -1154,10 +1155,15 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M
|
||||
|
||||
/* hardcoded preview .blend for cycles/internal, this should be solved
|
||||
* once with custom preview .blend path for external engines */
|
||||
if ((method != PR_NODE_RENDER) && BKE_scene_use_new_shading_nodes(scene))
|
||||
if ((method != PR_NODE_RENDER) &&
|
||||
id_type != ID_TE &&
|
||||
BKE_scene_use_new_shading_nodes(scene))
|
||||
{
|
||||
sp->pr_main = G_pr_main_cycles;
|
||||
else
|
||||
}
|
||||
else {
|
||||
sp->pr_main = G_pr_main;
|
||||
}
|
||||
|
||||
if (ob && ob->totcol) copy_v4_v4(sp->col, ob->col);
|
||||
else sp->col[0] = sp->col[1] = sp->col[2] = sp->col[3] = 1.0f;
|
||||
|
||||
Reference in New Issue
Block a user