diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-11-22 15:52:39 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-11-23 12:48:23 +0300 |
commit | 3abe8b3292cf7a50a9200b95401993384df24d9a (patch) | |
tree | 6c7a853710f1a4264dd1bb4d7b9bf14f44b75f33 /source/blender/editors/render | |
parent | fb7d23bdb2a5c0ed00067045e4acdf6593258b52 (diff) |
Rename any instance of scene layer or render layer in code with view layer
The RenderResult struct still has a listbase of RenderLayer, but that's ok
since this is strictly for rendering.
* Subversion bump (to 2.80.2)
* DNA low level doversion (renames) - only for .blend created since 2.80 started
Note: We can't use DNA_struct_elem_find or get file version in init_structDNA,
so we are manually iterating over the array of the SDNA elements instead.
Note 2: This doversion change with renames can be reverted in a few months. But
so far it's required for 2.8 files created between October 2016 and now.
Reviewers: campbellbarton, sergey
Differential Revision: https://developer.blender.org/D2927
Diffstat (limited to 'source/blender/editors/render')
-rw-r--r-- | source/blender/editors/render/render_intern.h | 4 | ||||
-rw-r--r-- | source/blender/editors/render/render_internal.c | 40 | ||||
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 22 | ||||
-rw-r--r-- | source/blender/editors/render/render_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/render/render_preview.c | 40 | ||||
-rw-r--r-- | source/blender/editors/render/render_shading.c | 102 | ||||
-rw-r--r-- | source/blender/editors/render/render_update.c | 4 |
7 files changed, 108 insertions, 108 deletions
diff --git a/source/blender/editors/render/render_intern.h b/source/blender/editors/render/render_intern.h index fb07b03c286..2bc96a7f218 100644 --- a/source/blender/editors/render/render_intern.h +++ b/source/blender/editors/render/render_intern.h @@ -53,8 +53,8 @@ void WORLD_OT_new(struct wmOperatorType *ot); void MATERIAL_OT_copy(struct wmOperatorType *ot); void MATERIAL_OT_paste(struct wmOperatorType *ot); -void SCENE_OT_render_layer_add(struct wmOperatorType *ot); -void SCENE_OT_render_layer_remove(struct wmOperatorType *ot); +void SCENE_OT_view_layer_add(struct wmOperatorType *ot); +void SCENE_OT_view_layer_remove(struct wmOperatorType *ot); void SCENE_OT_render_view_add(struct wmOperatorType *ot); void SCENE_OT_render_view_remove(struct wmOperatorType *ot); diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 8119e88eeaa..2c659d2b985 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -101,7 +101,7 @@ static int render_break(void *rjv); typedef struct RenderJob { Main *main; Scene *scene; - SceneLayer *scene_layer; + ViewLayer *view_layer; Scene *current_scene; /* TODO(sergey): Should not be needed once engine will have own * depsgraph and copy-on-write will be implemented. @@ -260,7 +260,7 @@ static void image_buffer_rect_update(RenderJob *rj, RenderResult *rr, ImBuf *ibu /* set callbacks, exported to sequence render too. * Only call in foreground (UI) renders. */ -static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **scene, SceneLayer **scene_layer) +static void screen_render_view_layer_set(wmOperator *op, Main *mainp, Scene **scene, ViewLayer **view_layer) { /* single layer re-render */ if (RNA_struct_property_is_set(op->ptr, "scene")) { @@ -280,14 +280,14 @@ static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **s } if (RNA_struct_property_is_set(op->ptr, "layer")) { - SceneLayer *rl; + ViewLayer *rl; char rl_name[RE_MAXNAME]; RNA_string_get(op->ptr, "layer", rl_name); - rl = (SceneLayer *)BLI_findstring(&(*scene)->render_layers, rl_name, offsetof(SceneLayer, name)); + rl = (ViewLayer *)BLI_findstring(&(*scene)->view_layers, rl_name, offsetof(ViewLayer, name)); if (rl) - *scene_layer = rl; + *view_layer = rl; } } @@ -295,7 +295,7 @@ static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **s static int screen_render_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = NULL; + ViewLayer *view_layer = NULL; Depsgraph *depsgraph = CTX_data_depsgraph(C); Render *re; Image *ima; @@ -307,7 +307,7 @@ static int screen_render_exec(bContext *C, wmOperator *op) struct Object *camera_override = v3d ? V3D_CAMERA_LOCAL(v3d) : NULL; /* custom scene and single layer re-render */ - screen_render_scene_layer_set(op, mainp, &scene, &scene_layer); + screen_render_view_layer_set(op, mainp, &scene, &view_layer); if (!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.im_format.imtype)) { BKE_report(op->reports, RPT_ERROR, "Cannot write a single file with an animation format selected"); @@ -337,13 +337,13 @@ static int screen_render_exec(bContext *C, wmOperator *op) if (is_animation) RE_BlenderAnim(re, mainp, scene, camera_override, lay_override, scene->r.sfra, scene->r.efra, scene->r.frame_step); else - RE_BlenderFrame(re, mainp, scene, scene_layer, camera_override, lay_override, scene->r.cfra, is_write_still); + RE_BlenderFrame(re, mainp, scene, view_layer, camera_override, lay_override, scene->r.cfra, is_write_still); BLI_end_threaded_malloc(); RE_SetReports(re, NULL); // no redraw needed, we leave state as we entered it - ED_update_for_newframe(mainp, scene, scene_layer, depsgraph); + ED_update_for_newframe(mainp, scene, view_layer, depsgraph); WM_event_add_notifier(C, NC_SCENE | ND_RENDER_RESULT, scene); @@ -614,7 +614,7 @@ static void render_startjob(void *rjv, short *stop, short *do_update, float *pro if (rj->anim) RE_BlenderAnim(rj->re, rj->main, rj->scene, rj->camera_override, rj->lay_override, rj->scene->r.sfra, rj->scene->r.efra, rj->scene->r.frame_step); else - RE_BlenderFrame(rj->re, rj->main, rj->scene, rj->scene_layer, rj->camera_override, rj->lay_override, rj->scene->r.cfra, rj->write_still); + RE_BlenderFrame(rj->re, rj->main, rj->scene, rj->view_layer, rj->camera_override, rj->lay_override, rj->scene->r.cfra, rj->write_still); RE_SetReports(rj->re, NULL); } @@ -657,7 +657,7 @@ static void render_endjob(void *rjv) if (rj->anim && !(rj->scene->r.scemode & R_NO_FRAME_UPDATE)) { /* possible this fails of loading new file while rendering */ if (G.main->wm.first) { - ED_update_for_newframe(G.main, rj->scene, rj->scene_layer, rj->depsgraph); + ED_update_for_newframe(G.main, rj->scene, rj->view_layer, rj->depsgraph); } } @@ -667,7 +667,7 @@ static void render_endjob(void *rjv) /* potentially set by caller */ rj->scene->r.scemode &= ~R_NO_FRAME_UPDATE; - if (rj->scene_layer) { + if (rj->view_layer) { nodeUpdateID(rj->scene->nodetree, &rj->scene->id); WM_main_add_notifier(NC_NODE | NA_EDITED, rj->scene); } @@ -697,7 +697,7 @@ static void render_endjob(void *rjv) * engine API, so lets use simple and robust way for now * - sergey - */ - if (rj->scene->render_layers.first != rj->scene->render_layers.last || + if (rj->scene->view_layers.first != rj->scene->view_layers.last || rj->image_outdated) { void *lock; @@ -824,9 +824,9 @@ static void clean_viewport_memory(Main *bmain, Scene *scene) for (wmWindowManager *wm = bmain->wm.first; wm; wm = wm->id.next) { for (wmWindow *win = wm->windows.first; win; win = win->next) { WorkSpace *workspace = BKE_workspace_active_get(win->workspace_hook); - SceneLayer *scene_layer = BKE_scene_layer_from_workspace_get(scene, workspace); + ViewLayer *view_layer = BKE_view_layer_from_workspace_get(scene, workspace); - for (base = scene_layer->object_bases.first; base; base = base->next) { + for (base = view_layer->object_bases.first; base; base = base->next) { clean_viewport_memory_base(base); } } @@ -842,7 +842,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even { /* new render clears all callbacks */ Main *mainp; - SceneLayer *scene_layer = NULL; + ViewLayer *view_layer = NULL; Scene *scene = CTX_data_scene(C); Render *re; wmJob *wm_job; @@ -910,7 +910,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even jobflag = WM_JOB_EXCL_RENDER | WM_JOB_PRIORITY | WM_JOB_PROGRESS; /* custom scene and single layer re-render */ - screen_render_scene_layer_set(op, mainp, &scene, &scene_layer); + screen_render_view_layer_set(op, mainp, &scene, &view_layer); if (RNA_struct_property_is_set(op->ptr, "layer")) jobflag |= WM_JOB_SUSPEND; @@ -920,7 +920,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even rj->main = mainp; rj->scene = scene; rj->current_scene = rj->scene; - rj->scene_layer = scene_layer; + rj->view_layer = view_layer; /* TODO(sergey): Render engine should be using own depsgraph. */ rj->depsgraph = CTX_data_depsgraph(C); rj->camera_override = camera_override; @@ -1280,10 +1280,10 @@ static void render_view3d_startjob(void *customdata, short *stop, short *do_upda /* initalize always */ if (use_border) { rdata.mode |= R_BORDER; - RE_InitState(re, NULL, &rdata, &rp->scene->render_layers, rp->scene->active_layer, &rp->scene->view_render, NULL, rp->ar->winx, rp->ar->winy, &cliprct); + RE_InitState(re, NULL, &rdata, &rp->scene->view_layers, rp->scene->active_view_layer, &rp->scene->view_render, NULL, rp->ar->winx, rp->ar->winy, &cliprct); } else - RE_InitState(re, NULL, &rdata, &rp->scene->render_layers, rp->scene->active_layer, &rp->scene->view_render, NULL, rp->ar->winx, rp->ar->winy, NULL); + RE_InitState(re, NULL, &rdata, &rp->scene->view_layers, rp->scene->active_view_layer, &rp->scene->view_render, NULL, rp->ar->winx, rp->ar->winy, NULL); } if (orth) diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index e0193a0caea..a445f8dafea 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -95,7 +95,7 @@ typedef struct OGLRender { Render *re; Scene *scene; WorkSpace *workspace; - SceneLayer *scene_layer; + ViewLayer *view_layer; Depsgraph *depsgraph; View3D *v3d; @@ -269,7 +269,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 *scene_layer = oglrender->scene_layer; + ViewLayer *view_layer = oglrender->view_layer; ARegion *ar = oglrender->ar; View3D *v3d = oglrender->v3d; RegionView3D *rv3d = oglrender->rv3d; @@ -354,7 +354,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, scene_layer, v3d, ar, sizex, sizey, + &eval_ctx, scene, view_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); @@ -366,7 +366,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, scene_layer, scene->camera, oglrender->sizex, oglrender->sizey, + &eval_ctx, scene, view_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); @@ -666,7 +666,7 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op) oglrender->bmain = CTX_data_main(C); oglrender->scene = scene; oglrender->workspace = workspace; - oglrender->scene_layer = CTX_data_scene_layer(C); + oglrender->view_layer = CTX_data_view_layer(C); oglrender->depsgraph = CTX_data_depsgraph(C); oglrender->cfrao = scene->r.cfra; @@ -715,7 +715,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->render_layers, scene->active_layer, view_render, NULL, sizex, sizey, NULL); + RE_InitState(oglrender->re, NULL, &scene->r, &scene->view_layers, scene->active_view_layer, view_render, NULL, sizex, sizey, NULL); /* create render views */ screen_opengl_views_setup(oglrender); @@ -813,9 +813,9 @@ static void screen_opengl_render_end(bContext *C, OGLRender *oglrender) if (oglrender->timer) { /* exec will not have a timer */ Depsgraph *depsgraph = oglrender->depsgraph; - SceneLayer *scene_layer = oglrender->scene_layer; + ViewLayer *view_layer = oglrender->view_layer; scene->r.cfra = oglrender->cfrao; - BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, scene, scene_layer); + BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, scene, view_layer); WM_event_remove_timer(oglrender->wm, oglrender->win, oglrender->timer); } @@ -1015,7 +1015,7 @@ static bool screen_opengl_render_anim_step(bContext *C, wmOperator *op) Main *bmain = CTX_data_main(C); OGLRender *oglrender = op->customdata; Scene *scene = oglrender->scene; - SceneLayer *scene_layer = oglrender->scene_layer; + ViewLayer *view_layer = oglrender->view_layer; Depsgraph *depsgraph = oglrender->depsgraph; char name[FILE_MAX]; bool ok = false; @@ -1027,7 +1027,7 @@ static bool screen_opengl_render_anim_step(bContext *C, wmOperator *op) if (CFRA < oglrender->nfra) CFRA++; while (CFRA < oglrender->nfra) { - BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, scene, scene_layer); + BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, scene, view_layer); CFRA++; } @@ -1049,7 +1049,7 @@ static bool screen_opengl_render_anim_step(bContext *C, wmOperator *op) WM_cursor_time(oglrender->win, scene->r.cfra); - BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, scene, scene_layer); + BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, scene, view_layer); if (view_context) { if (oglrender->rv3d->persp == RV3D_CAMOB && oglrender->v3d->camera && oglrender->v3d->scenelock) { diff --git a/source/blender/editors/render/render_ops.c b/source/blender/editors/render/render_ops.c index c09e8576dc2..bd75c6879e1 100644 --- a/source/blender/editors/render/render_ops.c +++ b/source/blender/editors/render/render_ops.c @@ -56,8 +56,8 @@ void ED_operatortypes_render(void) WM_operatortype_append(MATERIAL_OT_copy); WM_operatortype_append(MATERIAL_OT_paste); - WM_operatortype_append(SCENE_OT_render_layer_add); - WM_operatortype_append(SCENE_OT_render_layer_remove); + WM_operatortype_append(SCENE_OT_view_layer_add); + WM_operatortype_append(SCENE_OT_view_layer_remove); WM_operatortype_append(SCENE_OT_render_view_add); WM_operatortype_append(SCENE_OT_render_view_remove); diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 47eca1ccba3..47794e0e357 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -306,18 +306,18 @@ static const char *preview_layer_name(const char pr_type) } } -static void set_preview_layer(SceneLayer *scene_layer, char pr_type) +static void set_preview_layer(ViewLayer *view_layer, char pr_type) { LayerCollection *lc; const char *collection_name = preview_layer_name(pr_type); - for (lc = scene_layer->layer_collections.first; lc; lc = lc->next) { + for (lc = view_layer->layer_collections.first; lc; lc = lc->next) { if (STREQ(lc->scene_collection->name, collection_name)) { lc->flag = COLLECTION_VISIBLE | COLLECTION_DISABLED; - BKE_collection_enable(scene_layer, lc); + BKE_collection_enable(view_layer, lc); } else { - BKE_collection_disable(scene_layer, lc); + BKE_collection_disable(view_layer, lc); } } } @@ -346,7 +346,7 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty sce = preview_get_scene(pr_main); if (sce) { - SceneLayer *scene_layer = BKE_scene_layer_from_scene_get(sce); + ViewLayer *view_layer = BKE_view_layer_from_scene_get(sce); /* this flag tells render to not execute depsgraph or ipos etc */ sce->r.scemode |= R_BUTS_PREVIEW; @@ -422,7 +422,7 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty /* this only works in a specific case where the preview.blend contains * an object starting with 'c' which has a material linked to it (not the obdata) * and that material has a fake shadow texture in the active texture slot */ - for (Base *base = scene_layer->object_bases.first; base; base = base->next) { + for (Base *base = view_layer->object_bases.first; base; base = base->next) { Object *ob = base->object; if (ob->id.name[2] == 'c') { Material *shadmat = give_current_material(ob, ob->actcol); @@ -439,7 +439,7 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty /* turn off bounce lights for volume, * doesn't make much visual difference and slows it down too */ - for (Base *base = scene_layer->object_bases.first; base; base = base->next) { + for (Base *base = view_layer->object_bases.first; base; base = base->next) { Object *ob = base->object; if (ob->type == OB_LAMP) { /* if doesn't match 'Lamp.002' --> main key light */ @@ -463,10 +463,10 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty if (sp->pr_method == PR_ICON_RENDER) { if (mat->material_type == MA_TYPE_HALO) { - set_preview_layer(scene_layer, MA_FLAT); + set_preview_layer(view_layer, MA_FLAT); } else { - set_preview_layer(scene_layer, MA_SPHERE_A); + set_preview_layer(view_layer, MA_SPHERE_A); /* same as above, use current scene world to light sphere */ if (BKE_scene_use_new_shading_nodes(scene)) @@ -474,7 +474,7 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty } } else { - set_preview_layer(scene_layer, mat->pr_type); + set_preview_layer(view_layer, mat->pr_type); if (mat->nodetree && sp->pr_method == PR_NODE_RENDER) { /* two previews, they get copied by wmJob */ @@ -488,7 +488,7 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty } - for (Base *base = scene_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') { /* copy over object color, in case material uses it */ copy_v4_v4(base->object->col, sp->col); @@ -515,9 +515,9 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty sp->texcopy = tex; BLI_addtail(&pr_main->tex, tex); } - set_preview_layer(scene_layer, MA_TEXTURE); + set_preview_layer(view_layer, MA_TEXTURE); - for (Base *base = scene_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] == 't') { Material *mat = give_current_material(base->object, base->object->actcol); if (mat && mat->mtex[0]) { @@ -558,21 +558,21 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty if (!BKE_scene_use_new_shading_nodes(scene)) { if (la && la->type == LA_SUN && (la->sun_effect_type & LA_SUN_EFFECT_SKY)) { - set_preview_layer(scene_layer, MA_ATMOS); + set_preview_layer(view_layer, MA_ATMOS); sce->world = preview_get_localized_world(sp, scene->world); sce->camera = (Object *)BLI_findstring(&pr_main->object, "CameraAtmo", offsetof(ID, name) + 2); } else { sce->world = NULL; sce->camera = (Object *)BLI_findstring(&pr_main->object, "Camera", offsetof(ID, name) + 2); - set_preview_layer(scene_layer, MA_LAMP); + set_preview_layer(view_layer, MA_LAMP); } } else { - set_preview_layer(scene_layer, MA_LAMP); + set_preview_layer(view_layer, MA_LAMP); } - for (Base *base = scene_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->type == OB_LAMP) base->object->data = la; @@ -594,7 +594,7 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty BLI_addtail(&pr_main->world, wrld); } - set_preview_layer(scene_layer, MA_SKY); + set_preview_layer(view_layer, MA_SKY); sce->world = wrld; if (wrld && wrld->nodetree && sp->pr_method == PR_NODE_RENDER) { @@ -604,11 +604,11 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty } } - Depsgraph *depsgraph = BKE_scene_get_depsgraph(sce, scene_layer, true); + Depsgraph *depsgraph = BKE_scene_get_depsgraph(sce, view_layer, true); /* TODO(sergey): Use proper flag for tagging here. */ DEG_graph_id_tag_update(pr_main, depsgraph, &sce->id, 0); DEG_relations_tag_update(pr_main); - BKE_scene_graph_update_tagged(pr_main->eval_ctx, depsgraph, pr_main, sce, scene_layer); + BKE_scene_graph_update_tagged(pr_main->eval_ctx, depsgraph, pr_main, sce, view_layer); return sce; } diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index a98751176fc..04604feab6a 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -624,12 +624,12 @@ void WORLD_OT_new(wmOperatorType *ot) /********************** render layer operators *********************/ -static int render_layer_add_exec(bContext *C, wmOperator *UNUSED(op)) +static int view_layer_add_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); - BKE_scene_layer_add(scene, NULL); - scene->active_layer = BLI_listbase_count(&scene->render_layers) - 1; + BKE_view_layer_add(scene, NULL); + scene->active_view_layer = BLI_listbase_count(&scene->view_layers) - 1; DEG_id_tag_update(&scene->id, 0); DEG_relations_tag_update(CTX_data_main(C)); @@ -638,27 +638,27 @@ static int render_layer_add_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -void SCENE_OT_render_layer_add(wmOperatorType *ot) +void SCENE_OT_view_layer_add(wmOperatorType *ot) { /* identifiers */ - ot->name = "Add Render Layer"; - ot->idname = "SCENE_OT_render_layer_add"; - ot->description = "Add a render layer"; + ot->name = "Add View Layer"; + ot->idname = "SCENE_OT_view_layer_add"; + ot->description = "Add a view layer"; /* api callbacks */ - ot->exec = render_layer_add_exec; + ot->exec = view_layer_add_exec; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL; } -static int render_layer_remove_exec(bContext *C, wmOperator *UNUSED(op)) +static int view_layer_remove_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BKE_scene_layer_from_scene_get(scene); + ViewLayer *view_layer = BKE_view_layer_from_scene_get(scene); - if (!ED_scene_render_layer_delete(bmain, scene, scene_layer, NULL)) { + if (!ED_scene_view_layer_delete(bmain, scene, view_layer, NULL)) { return OPERATOR_CANCELLED; } @@ -667,15 +667,15 @@ static int render_layer_remove_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -void SCENE_OT_render_layer_remove(wmOperatorType *ot) +void SCENE_OT_view_layer_remove(wmOperatorType *ot) { /* identifiers */ - ot->name = "Remove Render Layer"; - ot->idname = "SCENE_OT_render_layer_remove"; - ot->description = "Remove the selected render layer"; + ot->name = "Remove View Layer"; + ot->idname = "SCENE_OT_view_layer_remove"; + ot->description = "Remove the selected view layer"; /* api callbacks */ - ot->exec = render_layer_remove_exec; + ot->exec = view_layer_remove_exec; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL; @@ -772,9 +772,9 @@ static int freestyle_active_module_poll(bContext *C) static int freestyle_module_add_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); - BKE_freestyle_module_add(&scene_layer->freestyle_config); + BKE_freestyle_module_add(&view_layer->freestyle_config); WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); @@ -798,11 +798,11 @@ void SCENE_OT_freestyle_module_add(wmOperatorType *ot) static int freestyle_module_remove_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); PointerRNA ptr = CTX_data_pointer_get_type(C, "freestyle_module", &RNA_FreestyleModuleSettings); FreestyleModuleConfig *module = ptr.data; - BKE_freestyle_module_delete(&scene_layer->freestyle_config, module); + BKE_freestyle_module_delete(&view_layer->freestyle_config, module); DEG_id_tag_update(&scene->id, 0); WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); @@ -828,12 +828,12 @@ void SCENE_OT_freestyle_module_remove(wmOperatorType *ot) static int freestyle_module_move_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); PointerRNA ptr = CTX_data_pointer_get_type(C, "freestyle_module", &RNA_FreestyleModuleSettings); FreestyleModuleConfig *module = ptr.data; int dir = RNA_enum_get(op->ptr, "direction"); - if (BKE_freestyle_module_move(&scene_layer->freestyle_config, module, dir)) { + if (BKE_freestyle_module_move(&view_layer->freestyle_config, module, dir)) { DEG_id_tag_update(&scene->id, 0); WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); } @@ -870,9 +870,9 @@ static int freestyle_lineset_add_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); - BKE_freestyle_lineset_add(bmain, &scene_layer->freestyle_config, NULL); + BKE_freestyle_lineset_add(bmain, &view_layer->freestyle_config, NULL); DEG_id_tag_update(&scene->id, 0); WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); @@ -897,21 +897,21 @@ void SCENE_OT_freestyle_lineset_add(wmOperatorType *ot) static int freestyle_active_lineset_poll(bContext *C) { Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); - if (!scene_layer) { + if (!view_layer) { return false; } - return BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config) != NULL; + return BKE_freestyle_lineset_get_active(&view_layer->freestyle_config) != NULL; } static int freestyle_lineset_copy_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); - FRS_copy_active_lineset(&scene_layer->freestyle_config); + FRS_copy_active_lineset(&view_layer->freestyle_config); return OPERATOR_FINISHED; } @@ -934,9 +934,9 @@ void SCENE_OT_freestyle_lineset_copy(wmOperatorType *ot) static int freestyle_lineset_paste_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); - FRS_paste_active_lineset(&scene_layer->freestyle_config); + FRS_paste_active_lineset(&view_layer->freestyle_config); DEG_id_tag_update(&scene->id, 0); WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); @@ -962,9 +962,9 @@ void SCENE_OT_freestyle_lineset_paste(wmOperatorType *ot) static int freestyle_lineset_remove_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); - FRS_delete_active_lineset(&scene_layer->freestyle_config); + FRS_delete_active_lineset(&view_layer->freestyle_config); DEG_id_tag_update(&scene->id, 0); WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); @@ -990,10 +990,10 @@ void SCENE_OT_freestyle_lineset_remove(wmOperatorType *ot) static int freestyle_lineset_move_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); int dir = RNA_enum_get(op->ptr, "direction"); - if (FRS_move_active_lineset(&scene_layer->freestyle_config, dir)) { + if (FRS_move_active_lineset(&view_layer->freestyle_config, dir)) { DEG_id_tag_update(&scene->id, 0); WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); } @@ -1030,8 +1030,8 @@ static int freestyle_linestyle_new_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); - FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); + FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&view_layer->freestyle_config); if (!lineset) { BKE_report(op->reports, RPT_ERROR, "No active lineset to add a new line style to"); @@ -1068,8 +1068,8 @@ void SCENE_OT_freestyle_linestyle_new(wmOperatorType *ot) static int freestyle_color_modifier_add_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); - FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); + FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&view_layer->freestyle_config); int type = RNA_enum_get(op->ptr, "type"); if (!freestyle_linestyle_check_report(lineset, op->reports)) { @@ -1108,8 +1108,8 @@ void SCENE_OT_freestyle_color_modifier_add(wmOperatorType *ot) static int freestyle_alpha_modifier_add_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); - FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); + FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&view_layer->freestyle_config); int type = RNA_enum_get(op->ptr, "type"); if (!freestyle_linestyle_check_report(lineset, op->reports)) { @@ -1148,8 +1148,8 @@ void SCENE_OT_freestyle_alpha_modifier_add(wmOperatorType *ot) static int freestyle_thickness_modifier_add_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); - FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); + FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&view_layer->freestyle_config); int type = RNA_enum_get(op->ptr, "type"); if (!freestyle_linestyle_check_report(lineset, op->reports)) { @@ -1188,8 +1188,8 @@ void SCENE_OT_freestyle_thickness_modifier_add(wmOperatorType *ot) static int freestyle_geometry_modifier_add_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); - FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); + FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&view_layer->freestyle_config); int type = RNA_enum_get(op->ptr, "type"); if (!freestyle_linestyle_check_report(lineset, op->reports)) { @@ -1241,8 +1241,8 @@ static int freestyle_get_modifier_type(PointerRNA *ptr) static int freestyle_modifier_remove_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); - FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); + FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&view_layer->freestyle_config); PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_LineStyleModifier); LineStyleModifier *modifier = ptr.data; @@ -1291,8 +1291,8 @@ void SCENE_OT_freestyle_modifier_remove(wmOperatorType *ot) static int freestyle_modifier_copy_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); - FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); + FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&view_layer->freestyle_config); PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_LineStyleModifier); LineStyleModifier *modifier = ptr.data; @@ -1341,8 +1341,8 @@ void SCENE_OT_freestyle_modifier_copy(wmOperatorType *ot) static int freestyle_modifier_move_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); - FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); + FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&view_layer->freestyle_config); PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_LineStyleModifier); LineStyleModifier *modifier = ptr.data; int dir = RNA_enum_get(op->ptr, "direction"); diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c index f38b190b92c..ec89e32cfaa 100644 --- a/source/blender/editors/render/render_update.c +++ b/source/blender/editors/render/render_update.c @@ -396,7 +396,7 @@ static void texture_changed(Main *bmain, Tex *tex) Lamp *la; World *wo; Scene *scene; - SceneLayer *sl; + ViewLayer *sl; Object *ob; bNode *node; bool texture_draw = false; @@ -406,7 +406,7 @@ static void texture_changed(Main *bmain, Tex *tex) /* paint overlays */ for (scene = bmain->scene.first; scene; scene = scene->id.next) { - for (sl = scene->render_layers.first; sl; sl = sl->next) { + for (sl = scene->view_layers.first; sl; sl = sl->next) { BKE_paint_invalidate_overlay_tex(scene, sl, tex); } } |