diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-10-16 22:15:03 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-10-16 22:29:04 +0300 |
commit | e4f2b2be26adbb5c34231598526a270559c6e183 (patch) | |
tree | 40601b1349372904cffe619003dcc83b7011d8be /source/blender/editors/render/render_opengl.c | |
parent | e8962f90de4222d6f750d3d3478eff65490365d8 (diff) |
Workspace: Move engines to workspace and Properties Editor cleanup
Engine is not stored in WorkSpaces. That defines the "context" engine, which
is used for the entire UI.
The engine used for the poll of nodes (add node menu, new nodes when "Use Nodes")
is obtained from context.
Introduce a ViewRender struct for viewport settings that are defined for
workspaces and scene. This struct will be populated with the hand-picked
settings that can be defined per workspace as per the 2.8 design.
* use_scene_settings
* properties editor: workshop + organize context path
Use Scene Settings
==================
For viewport drawing, Workspaces have an option to use the Scene render
settings (F12) instead of the viewport settings.
This way users can quickly preview the final render settings, engine and
View Layer. This will affect all the editors in that workspace, and it will be
clearly indicated in the top-bar.
Properties Editor: Add Workspace and organize context path
==========================================================
We now have the properties of:
Scene, Scene > Layer, Scene > World, Workspace
[Scene | Workspace] > Render Layer > Object
[Scene | Workspace] > Render Layer > Object > Data
(...)
Reviewers: Campbell Barton, Julian Eisel
Differential Revision: https://developer.blender.org/D2842
Diffstat (limited to 'source/blender/editors/render/render_opengl.c')
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index af932c27c5e..c17beded91e 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -94,6 +94,7 @@ typedef struct OGLRender { Main *bmain; Render *re; Scene *scene; + WorkSpace *workspace; SceneLayer *scene_layer; View3D *v3d; @@ -267,7 +268,7 @@ static void screen_opengl_views_setup(OGLRender *oglrender) static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, RenderResult *rr) { Scene *scene = oglrender->scene; - SceneLayer *sl = oglrender->scene_layer; + SceneLayer *scene_layer = oglrender->scene_layer; ARegion *ar = oglrender->ar; View3D *v3d = oglrender->v3d; RegionView3D *rv3d = oglrender->rv3d; @@ -352,7 +353,7 @@ static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, R if (view_context) { ibuf_view = ED_view3d_draw_offscreen_imbuf( - &eval_ctx, scene, sl, v3d, ar, sizex, sizey, + &eval_ctx, scene, scene_layer, v3d, ar, sizex, sizey, IB_rect, draw_bgpic, alpha_mode, oglrender->ofs_samples, oglrender->ofs_full_samples, viewname, oglrender->fx, oglrender->ofs, err_out); @@ -364,7 +365,7 @@ static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, R } else { ibuf_view = ED_view3d_draw_offscreen_imbuf_simple( - &eval_ctx, scene, sl, scene->camera, oglrender->sizex, oglrender->sizey, + &eval_ctx, scene, scene_layer, scene->camera, oglrender->sizex, oglrender->sizey, IB_rect, OB_SOLID, false, true, true, alpha_mode, oglrender->ofs_samples, oglrender->ofs_full_samples, viewname, oglrender->fx, oglrender->ofs, err_out); @@ -591,6 +592,7 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op) /* new render clears all callbacks */ wmWindowManager *wm = CTX_wm_manager(C); wmWindow *win = CTX_wm_window(C); + WorkSpace *workspace = CTX_wm_workspace(C); Scene *scene = CTX_data_scene(C); ScrArea *prevsa = CTX_wm_area(C); @@ -662,6 +664,7 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op) oglrender->sizey = sizey; oglrender->bmain = CTX_data_main(C); oglrender->scene = scene; + oglrender->workspace = workspace; oglrender->scene_layer = CTX_data_scene_layer(C); oglrender->cfrao = scene->r.cfra; @@ -698,6 +701,8 @@ 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"); @@ -708,7 +713,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, NULL, sizex, sizey, NULL); + RE_InitState(oglrender->re, NULL, &scene->r, view_render, NULL, sizex, sizey, NULL); /* create render views */ screen_opengl_views_setup(oglrender); |