Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/render/render_preview.c
| Context not available. | |||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_blenlib.h" | #include "BLI_blenlib.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_threads.h" | |||||
bdancer: Forget to remove this line, it's not needed. | |||||
| #include "BLO_readfile.h" | #include "BLO_readfile.h" | ||||
| Context not available. | |||||
| #include "PIL_time.h" | #include "PIL_time.h" | ||||
| #include "RE_pipeline.h" | #include "RE_pipeline.h" | ||||
| #include "RE_engine.h" | |||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| Context not available. | |||||
| WM_jobs_start(CTX_wm_manager(C), wm_job); | WM_jobs_start(CTX_wm_manager(C), wm_job); | ||||
| } | } | ||||
sergeyUnsubmitted Not Done Inline ActionsUnneeded whitespace change. sergey: Unneeded whitespace change. | |||||
| void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, MTex *slot, int sizex, int sizey, int method) | void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, MTex *slot, int sizex, int sizey, int method) | ||||
| { | { | ||||
| Object *ob = CTX_data_active_object(C); | Object *ob = CTX_data_active_object(C); | ||||
| wmJob *wm_job; | wmJob *wm_job; | ||||
| ShaderPreview *sp; | ShaderPreview *sp; | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| RenderEngineType *et = RE_engines_find(scene->r.engine); | |||||
| short id_type = GS(id->name); | short id_type = GS(id->name); | ||||
| bool use_new_shading = BKE_scene_use_new_shading_nodes(scene); | bool use_new_shading = BKE_scene_use_new_shading_nodes(scene); | ||||
| Context not available. | |||||
| sp->parent = parent; | sp->parent = parent; | ||||
| sp->slot = slot; | sp->slot = slot; | ||||
| /* hardcoded preview .blend for cycles/internal, this should be solved | if (et && et->render && et->preview_main) | ||||
sergeyUnsubmitted Not Done Inline ActionsWhat's the reason of removing braces? We're tending to sue braces even for single-operator blocks. Changing such things is not really good together with adding new functionality.. sergey: What's the reason of removing braces? We're tending to sue braces even for single-operator… | |||||
bdancerAuthorUnsubmitted Not Done Inline ActionsHm, I have to read Blender's code style guide more carefully. bdancer: Hm, I have to read Blender's code style guide more carefully. | |||||
| * once with custom preview .blend path for external engines */ | sp->pr_main = et->preview_main; | ||||
| if ((method != PR_NODE_RENDER) && id_type != ID_TE && use_new_shading) { | else if ((method != PR_NODE_RENDER) && id_type != ID_TE && use_new_shading) | ||||
| sp->pr_main = G_pr_main_cycles; | sp->pr_main = G_pr_main_cycles; | ||||
| } | else | ||||
| else { | |||||
| sp->pr_main = G_pr_main; | sp->pr_main = G_pr_main; | ||||
| } | |||||
| if (ob && ob->totcol) copy_v4_v4(sp->col, ob->col); | 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; | else sp->col[0] = sp->col[1] = sp->col[2] = sp->col[3] = 1.0f; | ||||
| Context not available. | |||||
Forget to remove this line, it's not needed.