Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/render/render_preview.c
| Show First 20 Lines • Show All 449 Lines • ▼ Show 20 Lines | if (id_type == ID_MA) { | ||||
| /* two previews, they get copied by wmJob */ | /* two previews, they get copied by wmJob */ | ||||
| BKE_node_preview_init_tree(mat->nodetree, sp->sizex, sp->sizey, true); | BKE_node_preview_init_tree(mat->nodetree, sp->sizex, sp->sizey, true); | ||||
| /* WATCH: Accessing origmat is not safe! */ | /* WATCH: Accessing origmat is not safe! */ | ||||
| BKE_node_preview_init_tree(origmat->nodetree, sp->sizex, sp->sizey, true); | BKE_node_preview_init_tree(origmat->nodetree, sp->sizex, sp->sizey, true); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| sce->r.mode &= ~(R_OSA); | sce->display.render_aa = SCE_DISPLAY_AA_OFF; | ||||
| } | } | ||||
| for (Base *base = view_layer->object_bases.first; base; base = base->next) { | for (Base *base = view_layer->object_bases.first; base; base = base->next) { | ||||
| if (base->object->id.name[2] == 'p') { | if (base->object->id.name[2] == 'p') { | ||||
| /* copy over object color, in case material uses it */ | /* copy over object color, in case material uses it */ | ||||
| copy_v4_v4(base->object->color, sp->color); | copy_v4_v4(base->object->color, sp->color); | ||||
| if (OB_TYPE_SUPPORT_MATERIAL(base->object->type)) { | if (OB_TYPE_SUPPORT_MATERIAL(base->object->type)) { | ||||
| ▲ Show 20 Lines • Show All 400 Lines • ▼ Show 20 Lines | static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int first) | ||||
| } | } | ||||
| /* sce->r gets copied in RE_InitState! */ | /* sce->r gets copied in RE_InitState! */ | ||||
| sce->r.scemode &= ~(R_MATNODE_PREVIEW | R_TEXNODE_PREVIEW); | sce->r.scemode &= ~(R_MATNODE_PREVIEW | R_TEXNODE_PREVIEW); | ||||
| sce->r.scemode &= ~R_NO_IMAGE_LOAD; | sce->r.scemode &= ~R_NO_IMAGE_LOAD; | ||||
| if (sp->pr_method == PR_ICON_RENDER) { | if (sp->pr_method == PR_ICON_RENDER) { | ||||
| sce->r.scemode |= R_NO_IMAGE_LOAD; | sce->r.scemode |= R_NO_IMAGE_LOAD; | ||||
| sce->r.mode |= R_OSA; | sce->display.render_aa = SCE_DISPLAY_AA_SAMPLES_8; | ||||
| } | } | ||||
| else if (sp->pr_method == PR_NODE_RENDER) { | else if (sp->pr_method == PR_NODE_RENDER) { | ||||
| if (idtype == ID_MA) { | if (idtype == ID_MA) { | ||||
| sce->r.scemode |= R_MATNODE_PREVIEW; | sce->r.scemode |= R_MATNODE_PREVIEW; | ||||
| } | } | ||||
| else if (idtype == ID_TE) { | else if (idtype == ID_TE) { | ||||
| sce->r.scemode |= R_TEXNODE_PREVIEW; | sce->r.scemode |= R_TEXNODE_PREVIEW; | ||||
| } | } | ||||
| sce->r.mode &= ~R_OSA; | sce->display.render_aa = SCE_DISPLAY_AA_OFF; | ||||
| } | } | ||||
| else { /* PR_BUTS_RENDER */ | else { /* PR_BUTS_RENDER */ | ||||
| sce->r.mode |= R_OSA; | sce->display.render_aa = SCE_DISPLAY_AA_SAMPLES_8; | ||||
| } | } | ||||
| /* callbacs are cleared on GetRender() */ | /* callbacs are cleared on GetRender() */ | ||||
| if (ELEM(sp->pr_method, PR_BUTS_RENDER, PR_NODE_RENDER)) { | if (ELEM(sp->pr_method, PR_BUTS_RENDER, PR_NODE_RENDER)) { | ||||
| RE_display_update_cb(re, sp, shader_preview_update); | RE_display_update_cb(re, sp, shader_preview_update); | ||||
| } | } | ||||
| /* set this for all previews, default is react to G.is_break still */ | /* set this for all previews, default is react to G.is_break still */ | ||||
| RE_test_break_cb(re, sp, shader_preview_break); | RE_test_break_cb(re, sp, shader_preview_break); | ||||
| ▲ Show 20 Lines • Show All 584 Lines • Show Last 20 Lines | |||||