diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-17 14:35:05 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-18 17:35:38 +0300 |
commit | f9cf2e2f6cc779764f46dae7ceadc4bb2e9ddcb5 (patch) | |
tree | 0f409fce181813cab818bfb83a33779e38774684 /source/blender/editors/render/render_opengl.c | |
parent | 15850a8740ed95afdc5779e224bf40f7540a7d62 (diff) |
Workspaces: remove workspace engine, use 3D viewport draw mode instead.
ViewRender was removed, which means we can't get the render engine for files
saved in 2.8. We assume that any files saved in 2.8 were intended to use Eevee
and set the engine to that.
A fix included with this is that .blend thumbails now draw with Clay mode,
and never Eevee or Cycles. These were drawn with solid mode in 2.7, and should
be very fast and not e.g. load heavy image textures.
Differential Revision: https://developer.blender.org/D3156
Diffstat (limited to 'source/blender/editors/render/render_opengl.c')
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index a334d3abc68..840c5c2b5aa 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -351,7 +351,6 @@ static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, R char err_out[256] = "unknown"; ImBuf *ibuf_view; const int alpha_mode = (draw_sky) ? R_ADDSKY : R_ALPHAPREMUL; - struct RenderEngineType *engine_type = CTX_data_engine_type(C); unsigned int draw_flags = V3D_OFSDRAW_NONE; draw_flags |= (oglrender->ofs_full_samples) ? V3D_OFSDRAW_USE_FULL_SAMPLE : 0; @@ -360,7 +359,7 @@ static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, R draw_flags |= (draw_bgpic) ? V3D_OFSDRAW_USE_BACKGROUND : 0; ibuf_view = ED_view3d_draw_offscreen_imbuf( - depsgraph, scene, view_layer, engine_type, + depsgraph, scene, view_layer, v3d->drawtype, v3d, ar, sizex, sizey, IB_rectfloat, draw_flags, alpha_mode, oglrender->ofs_samples, viewname, oglrender->ofs, err_out); @@ -373,9 +372,9 @@ static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, R else { draw_flags |= (V3D_OFSDRAW_USE_GPENCIL | V3D_OFSDRAW_USE_BACKGROUND); ibuf_view = ED_view3d_draw_offscreen_imbuf_simple( - depsgraph, scene, view_layer, engine_type, + depsgraph, scene, view_layer, OB_SOLID, scene->camera, oglrender->sizex, oglrender->sizey, - IB_rectfloat, draw_flags, OB_SOLID, + IB_rectfloat, draw_flags, alpha_mode, oglrender->ofs_samples, viewname, oglrender->ofs, err_out); camera = scene->camera; @@ -708,8 +707,6 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op) /* create render */ oglrender->re = RE_NewSceneRender(scene); - ViewRender *view_render = BKE_viewrender_get(scene, workspace); - RE_SetEngineByID(oglrender->re, view_render->engine_id); /* create image and image user */ oglrender->ima = BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result"); @@ -720,7 +717,7 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op) oglrender->iuser.ok = 1; /* create render result */ - RE_InitState(oglrender->re, NULL, &scene->r, &scene->view_layers, scene->active_view_layer, view_render, NULL, sizex, sizey, NULL); + RE_InitState(oglrender->re, NULL, &scene->r, &scene->view_layers, scene->active_view_layer, NULL, sizex, sizey, NULL); /* create render views */ screen_opengl_views_setup(oglrender); |