diff options
Diffstat (limited to 'source/blender/render/intern')
-rw-r--r-- | source/blender/render/intern/include/render_types.h | 4 | ||||
-rw-r--r-- | source/blender/render/intern/include/rendercore.h | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/convertblender.c | 8 | ||||
-rw-r--r-- | source/blender/render/intern/source/envmap.c | 4 | ||||
-rw-r--r-- | source/blender/render/intern/source/external_engine.c | 16 | ||||
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 108 | ||||
-rw-r--r-- | source/blender/render/intern/source/pointdensity.c | 12 | ||||
-rw-r--r-- | source/blender/render/intern/source/render_result.c | 86 | ||||
-rw-r--r-- | source/blender/render/intern/source/rendercore.c | 8 |
9 files changed, 124 insertions, 124 deletions
diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 8f572c34f3d..d24aae6ac97 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -192,8 +192,8 @@ struct Render { struct Main *main; Scene *scene; RenderData r; - ListBase render_layers; - int active_layer; + ListBase view_layers; + int active_view_layer; World wrld; ViewRender view_render; struct Object *camera_override; diff --git a/source/blender/render/intern/include/rendercore.h b/source/blender/render/intern/include/rendercore.h index 14c3d798e4f..c01db7db53e 100644 --- a/source/blender/render/intern/include/rendercore.h +++ b/source/blender/render/intern/include/rendercore.h @@ -83,7 +83,7 @@ void zbufshade_sss_tile(struct RenderPart *pa); int get_sample_layers(struct RenderPart *pa, struct RenderLayer *rl, struct RenderLayer **rlpp); -void render_internal_update_passes(struct RenderEngine *engine, struct Scene *scene, struct SceneLayer *scene_layer); +void render_internal_update_passes(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer); /* -------- ray.c ------- */ diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 496349e4ca6..81ed4c71b17 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -4939,7 +4939,7 @@ static void dupli_render_particle_set(Render *re, Object *ob, int timeoffset, in dupli_render_particle_set(re, go->ob, timeoffset, level+1, enable); } -static int get_vector_renderlayers(Scene *UNUSED(sce)) +static int get_vector_viewlayers(Scene *UNUSED(sce)) { return 0; } @@ -5010,7 +5010,7 @@ static void database_init_objects(Render *re, unsigned int UNUSED(renderlay), in /* in the prev/next pass for making speed vectors, avoid creating * objects that are not on a renderlayer with a vector pass, can * save a lot of time in complex scenes */ - vectorlay= get_vector_renderlayers(re->scene); + vectorlay= get_vector_viewlayers(re->scene); #endif /* if the object is not visible, ignore it */ @@ -5203,7 +5203,7 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l /* applies changes fully */ if ((re->r.scemode & (R_NO_FRAME_UPDATE|R_BUTS_PREVIEW|R_VIEWPORT_PREVIEW))==0) { BKE_scene_graph_update_for_newframe(re->eval_ctx, re->depsgraph, re->main, re->scene, NULL); - render_update_anim_renderdata(re, &re->scene->r, &re->scene->render_layers); + render_update_anim_renderdata(re, &re->scene->r, &re->scene->view_layers); } /* if no camera, viewmat should have been set! */ @@ -5789,7 +5789,7 @@ void RE_Database_FromScene_Vectors(Render *re, Main *bmain, Scene *sce, unsigned } if (!re->test_break(re->tbh)) { - int vectorlay= get_vector_renderlayers(re->scene); + int vectorlay= get_vector_viewlayers(re->scene); for (step= 0; step<2; step++) { diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index c873de064eb..2a7aab58980 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -143,7 +143,7 @@ static Render *envmap_render_copy(Render *re, EnvMap *env) /* set up renderdata */ envre->r.mode &= ~(R_BORDER | R_PANORAMA | R_ORTHO | R_MBLUR); - BLI_freelistN(&envre->render_layers); + BLI_freelistN(&envre->view_layers); BLI_freelistN(&envre->r.views); envre->r.filtertype = 0; envre->r.tilex = envre->r.xsch / 2; @@ -151,7 +151,7 @@ static Render *envmap_render_copy(Render *re, EnvMap *env) envre->r.size = 100; envre->r.yasp = envre->r.xasp = 1; - RE_InitState(envre, NULL, &envre->r, &re->render_layers, re->active_layer, &envre->view_render, NULL, cuberes, cuberes, NULL); + RE_InitState(envre, NULL, &envre->r, &re->view_layers, re->active_view_layer, &envre->view_render, NULL, cuberes, cuberes, NULL); envre->main = re->main; envre->scene = re->scene; /* unsure about this... */ envre->scene_color_manage = re->scene_color_manage; diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c index 160f999f4e7..68077d4d93b 100644 --- a/source/blender/render/intern/source/external_engine.c +++ b/source/blender/render/intern/source/external_engine.c @@ -107,7 +107,7 @@ void RE_engines_exit(void) DRW_engines_free(); BKE_layer_collection_engine_settings_callback_free(); - BKE_scene_layer_engine_settings_callback_free(); + BKE_view_layer_engine_settings_callback_free(); for (type = R_engines.first; type; type = next) { next = type->next; @@ -133,7 +133,7 @@ void RE_engines_register(Main *bmain, RenderEngineType *render_type) bmain, render_type->idname, render_type->collection_settings_create); } if (render_type->render_settings_create) { - BKE_scene_layer_engine_settings_callback_register( + BKE_view_layer_engine_settings_callback_register( bmain, render_type->idname, render_type->render_settings_create); } BLI_addtail(&R_engines, render_type); @@ -658,7 +658,7 @@ int RE_engine_render(Render *re, int do_all) * creating the render result */ if ((re->r.scemode & (R_NO_FRAME_UPDATE | R_BUTS_PREVIEW)) == 0) { BKE_scene_graph_update_for_newframe(re->eval_ctx, re->depsgraph, re->main, re->scene, NULL); - render_update_anim_renderdata(re, &re->scene->r, &re->scene->render_layers); + render_update_anim_renderdata(re, &re->scene->r, &re->scene->view_layers); } /* create render result */ @@ -777,12 +777,12 @@ int RE_engine_render(Render *re, int do_all) return 1; } -void RE_engine_register_pass(struct RenderEngine *engine, struct Scene *scene, struct SceneLayer *scene_layer, +void RE_engine_register_pass(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer, const char *name, int UNUSED(channels), const char *UNUSED(chanid), int type) { /* The channel information is currently not used, but is part of the API in case it's needed in the future. */ - if (!(scene && scene_layer && engine)) { + if (!(scene && view_layer && engine)) { return; } @@ -792,12 +792,12 @@ void RE_engine_register_pass(struct RenderEngine *engine, struct Scene *scene, s Scene *sce; for (sce = G.main->scene.first; sce; sce = sce->id.next) { if (sce->nodetree) { - ntreeCompositRegisterPass(sce->nodetree, scene, scene_layer, name, type); + ntreeCompositRegisterPass(sce->nodetree, scene, view_layer, name, type); } } } -SceneLayer *RE_engine_get_scene_layer(Render *re) +ViewLayer *RE_engine_get_view_layer(Render *re) { - return re->eval_ctx->scene_layer; + return re->eval_ctx->view_layer; } diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index ed74696ba78..7fdaf38a9ff 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -264,7 +264,7 @@ RenderResult *RE_MultilayerConvert(void *exrhandle, const char *colorspace, bool RenderLayer *render_get_active_layer(Render *re, RenderResult *rr) { - RenderLayer *rl = BLI_findlink(&rr->layers, re->active_layer); + RenderLayer *rl = BLI_findlink(&rr->layers, re->active_view_layer); if (rl) return rl; @@ -274,10 +274,10 @@ RenderLayer *render_get_active_layer(Render *re, RenderResult *rr) static int render_scene_needs_vector(Render *re) { - SceneLayer *scene_layer; - for (scene_layer = re->render_layers.first; scene_layer; scene_layer = scene_layer->next) - if (scene_layer->flag & SCENE_LAYER_RENDER) { - if (scene_layer->passflag & SCE_PASS_VECTOR) { + ViewLayer *view_layer; + for (view_layer = re->view_layers.first; view_layer; view_layer = view_layer->next) + if (view_layer->flag & VIEW_LAYER_RENDER) { + if (view_layer->passflag & SCE_PASS_VECTOR) { return 1; } } @@ -286,9 +286,9 @@ static int render_scene_needs_vector(Render *re) static bool render_scene_has_layers_to_render(Scene *scene) { - SceneLayer *scene_layer; - for (scene_layer = scene->render_layers.first; scene_layer; scene_layer = scene_layer->next) { - if (scene_layer->flag & SCENE_LAYER_RENDER) { + ViewLayer *view_layer; + for (view_layer = scene->view_layers.first; view_layer; view_layer = view_layer->next) { + if (view_layer->flag & VIEW_LAYER_RENDER) { return true; } } @@ -584,7 +584,7 @@ void RE_FreeRender(Render *re) BLI_rw_mutex_end(&re->resultmutex); BLI_rw_mutex_end(&re->partsmutex); - BLI_freelistN(&re->render_layers); + BLI_freelistN(&re->view_layers); BLI_freelistN(&re->r.views); curvemapping_free_data(&re->r.mblur_shutter_curve); @@ -748,7 +748,7 @@ void render_copy_viewrender(ViewRender *to, ViewRender *from) /* disprect is optional, if NULL it assumes full window render */ void RE_InitState(Render *re, Render *source, RenderData *rd, ListBase *render_layers, const int active_layer, - ViewRender *view_render, SceneLayer *scene_layer, + ViewRender *view_render, ViewLayer *view_layer, int winx, int winy, rcti *disprect) { bool had_freestyle = (re->r.mode & R_EDGE_FRS) != 0; @@ -760,9 +760,9 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, /* copy render data and render layers for thread safety */ render_copy_renderdata(&re->r, rd); render_copy_viewrender(&re->view_render, view_render); - BLI_freelistN(&re->render_layers); - BLI_duplicatelist(&re->render_layers, render_layers); - re->active_layer = active_layer; + BLI_freelistN(&re->view_layers); + BLI_duplicatelist(&re->view_layers, render_layers); + re->active_view_layer = active_layer; if (source) { /* reuse border flags from source renderer */ @@ -811,10 +811,10 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, else re->osa = 0; } - if (scene_layer) { - int index = BLI_findindex(render_layers, scene_layer); + if (view_layer) { + int index = BLI_findindex(render_layers, view_layer); if (index != -1) { - re->active_layer = index; + re->active_view_layer = index; re->r.scemode |= R_SINGLE_LAYER; } } @@ -832,7 +832,7 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, re->result = NULL; } else if (re->result) { - SceneLayer *active_render_layer = BLI_findlink(&re->render_layers, re->active_layer); + ViewLayer *active_render_layer = BLI_findlink(&re->view_layers, re->active_view_layer); RenderLayer *rl; bool have_layer = false; @@ -976,8 +976,8 @@ void render_update_anim_renderdata(Render *re, RenderData *rd, ListBase *render_ re->r.unit_line_thickness = rd->unit_line_thickness; /* render layers */ - BLI_freelistN(&re->render_layers); - BLI_duplicatelist(&re->render_layers, render_layers); + BLI_freelistN(&re->view_layers); + BLI_duplicatelist(&re->view_layers, render_layers); /* render views */ BLI_freelistN(&re->r.views); @@ -1979,7 +1979,7 @@ static void render_scene(Render *re, Scene *sce, int cfra) } /* initial setup */ - RE_InitState(resc, re, &sce->r, &sce->render_layers, sce->active_layer, &sce->view_render, NULL, winx, winy, &re->disprect); + RE_InitState(resc, re, &sce->r, &sce->view_layers, sce->active_view_layer, &sce->view_render, NULL, winx, winy, &re->disprect); /* We still want to use 'rendercache' setting from org (main) scene... */ resc->r.scemode = (resc->r.scemode & ~R_EXR_CACHE_FILE) | (re->r.scemode & R_EXR_CACHE_FILE); @@ -2250,24 +2250,24 @@ static void init_freestyle(Render *re) /* invokes Freestyle stroke rendering */ static void add_freestyle(Render *re, int render) { - SceneLayer *scene_layer, *active_render_layer; + ViewLayer *view_layer, *active_view_layer; LinkData *link; Render *r; const bool do_link = (re->r.mode & R_MBLUR) == 0 || re->i.curblur == re->r.mblur_samples; - active_render_layer = BLI_findlink(&re->render_layers, re->active_layer); + active_view_layer = BLI_findlink(&re->view_layers, re->active_view_layer); FRS_begin_stroke_rendering(re); - for (scene_layer = (SceneLayer *)re->render_layers.first; scene_layer; scene_layer = scene_layer->next) { + for (view_layer = (ViewLayer *)re->view_layers.first; view_layer; view_layer = view_layer->next) { if (do_link) { link = (LinkData *)MEM_callocN(sizeof(LinkData), "LinkData to Freestyle render"); BLI_addtail(&re->freestyle_renders, link); } - if ((re->r.scemode & R_SINGLE_LAYER) && scene_layer != active_render_layer) + if ((re->r.scemode & R_SINGLE_LAYER) && view_layer != active_view_layer) continue; - if (FRS_is_freestyle_enabled(scene_layer)) { - r = FRS_do_stroke_rendering(re, scene_layer, render); + if (FRS_is_freestyle_enabled(view_layer)) { + r = FRS_do_stroke_rendering(re, view_layer, render); if (do_link) link->data = (void *)r; } @@ -2284,25 +2284,25 @@ static void composite_freestyle_renders(Render *re, int sample) { Render *freestyle_render; RenderView *rv; - SceneLayer *scene_layer, *active_scene_layer; + ViewLayer *view_layer, *active_view_layer; LinkData *link; - active_scene_layer = BLI_findlink(&re->render_layers, re->active_layer); + active_view_layer = BLI_findlink(&re->view_layers, re->active_view_layer); link = (LinkData *)re->freestyle_renders.first; for (rv = re->result->views.first; rv; rv = rv->next) { - for (scene_layer = (SceneLayer *)re->render_layers.first; scene_layer; scene_layer = scene_layer->next) { - if ((re->r.scemode & R_SINGLE_LAYER) && scene_layer != active_scene_layer) + for (view_layer = (ViewLayer *)re->view_layers.first; view_layer; view_layer = view_layer->next) { + if ((re->r.scemode & R_SINGLE_LAYER) && view_layer != active_view_layer) continue; - if (FRS_is_freestyle_enabled(scene_layer)) { + if (FRS_is_freestyle_enabled(view_layer)) { freestyle_render = (Render *)link->data; /* may be NULL in case of empty render layer */ if (freestyle_render) { render_result_exr_file_read_sample(freestyle_render, sample); - FRS_composite_result(re, scene_layer, freestyle_render); + FRS_composite_result(re, view_layer, freestyle_render); RE_FreeRenderResult(freestyle_render->result); freestyle_render->result = NULL; } @@ -2882,10 +2882,10 @@ bool RE_force_single_renderlayer(Scene *scene) { int scemode = check_mode_full_sample(&scene->r, &scene->view_render); if (scemode & R_SINGLE_LAYER) { - SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, scene->active_view_layer); /* force layer to be enabled */ - if ((scene_layer->flag & SCENE_LAYER_RENDER) == 0) { - scene_layer->flag |= SCENE_LAYER_RENDER; + if ((view_layer->flag & VIEW_LAYER_RENDER) == 0) { + view_layer->flag |= VIEW_LAYER_RENDER; return true; } } @@ -2901,7 +2901,7 @@ static bool check_valid_compositing_camera(Scene *scene, Object *camera_override if (node->type == CMP_NODE_R_LAYERS && (node->flag & NODE_MUTED) == 0) { Scene *sce = node->id ? (Scene *)node->id : scene; if (sce->camera == NULL) { - sce->camera = BKE_scene_layer_camera_find(BKE_scene_layer_from_scene_get(sce)); + sce->camera = BKE_view_layer_camera_find(BKE_view_layer_from_scene_get(sce)); } if (sce->camera == NULL) { /* all render layers nodes need camera */ @@ -2959,7 +2959,7 @@ static int check_valid_camera(Scene *scene, Object *camera_override, ReportList const char *err_msg = "No camera found in scene \"%s\""; if (camera_override == NULL && scene->camera == NULL) - scene->camera = BKE_scene_layer_camera_find(BKE_scene_layer_from_scene_get(scene)); + scene->camera = BKE_view_layer_camera_find(BKE_view_layer_from_scene_get(scene)); if (!check_valid_camera_multiview(scene, scene->camera, reports)) return false; @@ -2975,7 +2975,7 @@ static int check_valid_camera(Scene *scene, Object *camera_override, ReportList { if (!seq->scene_camera) { if (!seq->scene->camera && - !BKE_scene_layer_camera_find(BKE_scene_layer_from_scene_get(seq->scene))) + !BKE_view_layer_camera_find(BKE_view_layer_from_scene_get(seq->scene))) { /* camera could be unneeded due to composite nodes */ Object *override = (seq->scene == scene) ? camera_override : NULL; @@ -3142,15 +3142,15 @@ static void validate_render_settings(Render *re) } } -static void update_physics_cache(Render *re, Scene *scene, SceneLayer *scene_layer, int UNUSED(anim_init)) +static void update_physics_cache(Render *re, Scene *scene, ViewLayer *view_layer, int UNUSED(anim_init)) { PTCacheBaker baker; memset(&baker, 0, sizeof(baker)); baker.main = re->main; baker.scene = scene; - baker.scene_layer = scene_layer; - baker.depsgraph = BKE_scene_get_depsgraph(scene, scene_layer, true); + baker.view_layer = view_layer; + baker.depsgraph = BKE_scene_get_depsgraph(scene, view_layer, true); baker.bake = 0; baker.render = 1; baker.anim_init = 1; @@ -3176,7 +3176,7 @@ void RE_SetEngineByID(Render *re, const char *engine_id) /* evaluating scene options for general Blender render */ static int render_initialize_from_main(Render *re, RenderData *rd, Main *bmain, Scene *scene, ViewRender *view_render, - SceneLayer *scene_layer, Object *camera_override, unsigned int lay_override, + ViewLayer *view_layer, Object *camera_override, unsigned int lay_override, int anim, int anim_init) { int winx, winy; @@ -3215,7 +3215,7 @@ static int render_initialize_from_main(Render *re, RenderData *rd, Main *bmain, /* not too nice, but it survives anim-border render */ if (anim) { - render_update_anim_renderdata(re, &scene->r, &scene->render_layers); + render_update_anim_renderdata(re, &scene->r, &scene->view_layers); re->disprect = disprect; return 1; } @@ -3230,17 +3230,17 @@ static int render_initialize_from_main(Render *re, RenderData *rd, Main *bmain, */ if (0) { /* make sure dynamics are up to date */ - scene_layer = BKE_scene_layer_from_scene_get(scene); - update_physics_cache(re, scene, scene_layer, anim_init); + view_layer = BKE_view_layer_from_scene_get(scene); + update_physics_cache(re, scene, view_layer, anim_init); } - if (scene_layer || scene->r.scemode & R_SINGLE_LAYER) { + if (view_layer || scene->r.scemode & R_SINGLE_LAYER) { BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE); render_result_single_layer_begin(re); BLI_rw_mutex_unlock(&re->resultmutex); } - RE_InitState(re, NULL, &scene->r, &scene->render_layers, scene->active_layer, &scene->view_render, scene_layer, winx, winy, &disprect); + RE_InitState(re, NULL, &scene->r, &scene->view_layers, scene->active_view_layer, &scene->view_render, view_layer, winx, winy, &disprect); if (!re->ok) /* if an error was printed, abort */ return 0; @@ -3261,7 +3261,7 @@ void RE_SetReports(Render *re, ReportList *reports) } /* general Blender frame render call */ -void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneLayer *scene_layer, Object *camera_override, +void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, ViewLayer *view_layer, Object *camera_override, unsigned int lay_override, int frame, const bool write_still) { BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_INIT); @@ -3271,7 +3271,7 @@ void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneLayer *scene_la scene->r.cfra = frame; - if (render_initialize_from_main(re, &scene->r, bmain, scene, &scene->view_render, scene_layer, + if (render_initialize_from_main(re, &scene->r, bmain, scene, &scene->view_render, view_layer, camera_override, lay_override, 0, 0)) { MEM_reset_peak_memory(); @@ -3851,13 +3851,13 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri void RE_PreviewRender(Render *re, Main *bmain, Scene *sce, ViewRender *view_render) { Object *camera; - SceneLayer *scene_layer = BKE_scene_layer_from_scene_get(sce); + ViewLayer *view_layer = BKE_view_layer_from_scene_get(sce); int winx, winy; winx = (sce->r.size * sce->r.xsch) / 100; winy = (sce->r.size * sce->r.ysch) / 100; - RE_InitState(re, NULL, &sce->r, &sce->render_layers, sce->active_layer, view_render, NULL, winx, winy, NULL); + RE_InitState(re, NULL, &sce->r, &sce->view_layers, sce->active_view_layer, view_render, NULL, winx, winy, NULL); re->pool = BKE_image_pool_new(); @@ -3865,8 +3865,8 @@ void RE_PreviewRender(Render *re, Main *bmain, Scene *sce, ViewRender *view_rend re->scene = sce; re->scene_color_manage = BKE_scene_check_color_management_enabled(sce); re->lay = sce->lay; - re->depsgraph = BKE_scene_get_depsgraph(sce, scene_layer, false); - re->eval_ctx->scene_layer = scene_layer; + re->depsgraph = BKE_scene_get_depsgraph(sce, view_layer, false); + re->eval_ctx->view_layer = view_layer; camera = RE_GetCamera(re); RE_SetCamera(re, camera); @@ -3912,7 +3912,7 @@ bool RE_ReadRenderResult(Scene *scene, Scene *scenode) re = RE_GetSceneRender(scene); if (re == NULL) re = RE_NewSceneRender(scene); - RE_InitState(re, NULL, &scene->r, &scene->render_layers, scene->active_layer, &scene->view_render, NULL, winx, winy, &disprect); + RE_InitState(re, NULL, &scene->r, &scene->view_layers, scene->active_view_layer, &scene->view_render, NULL, winx, winy, &disprect); re->scene = scene; re->scene_color_manage = BKE_scene_check_color_management_enabled(scene); diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 04786858b6b..e94a452c94a 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -945,7 +945,7 @@ static void particle_system_minmax(EvaluationContext *eval_ctx, void RE_point_density_cache( Scene *scene, - SceneLayer *scene_layer, + ViewLayer *view_layer, PointDensity *pd, const bool use_render_params) { @@ -955,7 +955,7 @@ void RE_point_density_cache( DEG_evaluation_context_init(&eval_ctx, use_render_params ? DAG_EVAL_RENDER : DAG_EVAL_VIEWPORT); - eval_ctx.scene_layer = scene_layer; + eval_ctx.view_layer = view_layer; /* Same matricies/resolution as dupli_render_particle_set(). */ unit_m4(mat); @@ -966,7 +966,7 @@ void RE_point_density_cache( void RE_point_density_minmax( struct Scene *scene, - SceneLayer *scene_layer, + ViewLayer *view_layer, struct PointDensity *pd, const bool use_render_params, float r_min[3], float r_max[3]) @@ -997,7 +997,7 @@ void RE_point_density_minmax( DAG_EVAL_VIEWPORT); eval_ctx.ctime = (float)scene->r.cfra + scene->r.subframe; - eval_ctx.scene_layer = scene_layer; + eval_ctx.view_layer = view_layer; particle_system_minmax(&eval_ctx, scene, @@ -1070,7 +1070,7 @@ static void point_density_sample_func(void *data_v, const int iter) */ void RE_point_density_sample( Scene *scene, - SceneLayer *scene_layer, + ViewLayer *view_layer, PointDensity *pd, const int resolution, const bool use_render_params, @@ -1090,7 +1090,7 @@ void RE_point_density_sample( BLI_mutex_lock(&sample_mutex); RE_point_density_minmax(scene, - scene_layer, + view_layer, pd, use_render_params, min, diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c index 1b19307b9e8..53169c256a9 100644 --- a/source/blender/render/intern/source/render_result.c +++ b/source/blender/render/intern/source/render_result.c @@ -264,7 +264,7 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf RenderResult *rr; RenderLayer *rl; RenderView *rv; - SceneLayer *scene_layer; + ViewLayer *view_layer; int rectx, recty; int nr; @@ -294,19 +294,19 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf render_result_views_new(rr, &re->r); /* check renderdata for amount of layers */ - for (nr = 0, scene_layer = re->render_layers.first; scene_layer; scene_layer = scene_layer->next, nr++) { + for (nr = 0, view_layer = re->view_layers.first; view_layer; view_layer = view_layer->next, nr++) { if (layername && layername[0]) - if (!STREQ(scene_layer->name, layername)) + if (!STREQ(view_layer->name, layername)) continue; if (re->r.scemode & R_SINGLE_LAYER) { - if (nr != re->active_layer) { + if (nr != re->active_view_layer) { continue; } } else { - if ((scene_layer->flag & SCENE_LAYER_RENDER) == 0) { + if ((view_layer->flag & VIEW_LAYER_RENDER) == 0) { continue; } } @@ -314,10 +314,10 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf rl = MEM_callocN(sizeof(RenderLayer), "new render layer"); BLI_addtail(&rr->layers, rl); - BLI_strncpy(rl->name, scene_layer->name, sizeof(rl->name)); - rl->layflag = scene_layer->layflag; - rl->passflag = scene_layer->passflag; /* for debugging: scene_layer->passflag | SCE_PASS_RAYHITS; */ - rl->pass_xor = scene_layer->pass_xor; + BLI_strncpy(rl->name, view_layer->name, sizeof(rl->name)); + rl->layflag = view_layer->layflag; + rl->passflag = view_layer->passflag; /* for debugging: view_layer->passflag | SCE_PASS_RAYHITS; */ + rl->pass_xor = view_layer->pass_xor; rl->rectx = rectx; rl->recty = recty; @@ -352,65 +352,65 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf /* a renderlayer should always have a Combined pass*/ render_layer_add_pass(rr, rl, 4, "Combined", view, "RGBA"); - if (scene_layer->passflag & SCE_PASS_Z) + if (view_layer->passflag & SCE_PASS_Z) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 1, RE_PASSNAME_Z, view, "Z"); - if (scene_layer->passflag & SCE_PASS_VECTOR) + if (view_layer->passflag & SCE_PASS_VECTOR) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 4, RE_PASSNAME_VECTOR, view, "XYZW"); - if (scene_layer->passflag & SCE_PASS_NORMAL) + if (view_layer->passflag & SCE_PASS_NORMAL) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_NORMAL, view, "XYZ"); - if (scene_layer->passflag & SCE_PASS_UV) + if (view_layer->passflag & SCE_PASS_UV) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_UV, view, "UVA"); - if (scene_layer->passflag & SCE_PASS_RGBA) + if (view_layer->passflag & SCE_PASS_RGBA) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 4, RE_PASSNAME_RGBA, view, "RGBA"); - if (scene_layer->passflag & SCE_PASS_EMIT) + if (view_layer->passflag & SCE_PASS_EMIT) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_EMIT, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_DIFFUSE) + if (view_layer->passflag & SCE_PASS_DIFFUSE) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_DIFFUSE, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_SPEC) + if (view_layer->passflag & SCE_PASS_SPEC) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_SPEC, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_AO) + if (view_layer->passflag & SCE_PASS_AO) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_AO, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_ENVIRONMENT) + if (view_layer->passflag & SCE_PASS_ENVIRONMENT) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_ENVIRONMENT, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_INDIRECT) + if (view_layer->passflag & SCE_PASS_INDIRECT) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_INDIRECT, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_SHADOW) + if (view_layer->passflag & SCE_PASS_SHADOW) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_SHADOW, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_REFLECT) + if (view_layer->passflag & SCE_PASS_REFLECT) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_REFLECT, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_REFRACT) + if (view_layer->passflag & SCE_PASS_REFRACT) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_REFRACT, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_INDEXOB) + if (view_layer->passflag & SCE_PASS_INDEXOB) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 1, RE_PASSNAME_INDEXOB, view, "X"); - if (scene_layer->passflag & SCE_PASS_INDEXMA) + if (view_layer->passflag & SCE_PASS_INDEXMA) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 1, RE_PASSNAME_INDEXMA, view, "X"); - if (scene_layer->passflag & SCE_PASS_MIST) + if (view_layer->passflag & SCE_PASS_MIST) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 1, RE_PASSNAME_MIST, view, "Z"); if (rl->passflag & SCE_PASS_RAYHITS) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 4, RE_PASSNAME_RAYHITS, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_DIFFUSE_DIRECT) + if (view_layer->passflag & SCE_PASS_DIFFUSE_DIRECT) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_DIFFUSE_DIRECT, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_DIFFUSE_INDIRECT) + if (view_layer->passflag & SCE_PASS_DIFFUSE_INDIRECT) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_DIFFUSE_INDIRECT, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_DIFFUSE_COLOR) + if (view_layer->passflag & SCE_PASS_DIFFUSE_COLOR) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_DIFFUSE_COLOR, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_GLOSSY_DIRECT) + if (view_layer->passflag & SCE_PASS_GLOSSY_DIRECT) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_GLOSSY_DIRECT, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_GLOSSY_INDIRECT) + if (view_layer->passflag & SCE_PASS_GLOSSY_INDIRECT) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_GLOSSY_INDIRECT, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_GLOSSY_COLOR) + if (view_layer->passflag & SCE_PASS_GLOSSY_COLOR) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_GLOSSY_COLOR, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_TRANSM_DIRECT) + if (view_layer->passflag & SCE_PASS_TRANSM_DIRECT) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_TRANSM_DIRECT, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_TRANSM_INDIRECT) + if (view_layer->passflag & SCE_PASS_TRANSM_INDIRECT) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_TRANSM_INDIRECT, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_TRANSM_COLOR) + if (view_layer->passflag & SCE_PASS_TRANSM_COLOR) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_TRANSM_COLOR, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_SUBSURFACE_DIRECT) + if (view_layer->passflag & SCE_PASS_SUBSURFACE_DIRECT) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_SUBSURFACE_DIRECT, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_SUBSURFACE_INDIRECT) + if (view_layer->passflag & SCE_PASS_SUBSURFACE_INDIRECT) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_SUBSURFACE_INDIRECT, view, "RGB"); - if (scene_layer->passflag & SCE_PASS_SUBSURFACE_COLOR) + if (view_layer->passflag & SCE_PASS_SUBSURFACE_COLOR) RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_SUBSURFACE_COLOR, view, "RGB"); #undef RENDER_LAYER_ADD_PASS_SAFE } @@ -447,7 +447,7 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf rl->layflag = 0x7FFF; /* solid ztra halo strand */ rl->passflag = SCE_PASS_COMBINED; - re->active_layer = 0; + re->active_view_layer = 0; } /* border render; calculate offset for use in compositor. compo is centralized coords */ @@ -978,7 +978,7 @@ void render_result_single_layer_begin(Render *re) /* if scemode is R_SINGLE_LAYER, at end of rendering, merge the both render results */ void render_result_single_layer_end(Render *re) { - SceneLayer *scene_layer; + ViewLayer *view_layer; RenderLayer *rlpush; RenderLayer *rl; int nr; @@ -999,12 +999,12 @@ void render_result_single_layer_end(Render *re) BLI_remlink(&re->result->layers, rl); /* reconstruct render result layers */ - for (nr = 0, scene_layer = re->render_layers.first; scene_layer; scene_layer = scene_layer->next, nr++) { - if (nr == re->active_layer) { + for (nr = 0, view_layer = re->view_layers.first; view_layer; view_layer = view_layer->next, nr++) { + if (nr == re->active_view_layer) { BLI_addtail(&re->result->layers, rl); } else { - rlpush = RE_GetRenderLayer(re->pushedresult, scene_layer->name); + rlpush = RE_GetRenderLayer(re->pushedresult, view_layer->name); if (rlpush) { BLI_remlink(&re->pushedresult->layers, rlpush); BLI_addtail(&re->result->layers, rlpush); diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index a129e64db49..c9072105dd9 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -1992,18 +1992,18 @@ void add_halo_flare(Render *re) } } -void render_internal_update_passes(RenderEngine *engine, Scene *scene, SceneLayer *scene_layer) +void render_internal_update_passes(RenderEngine *engine, Scene *scene, ViewLayer *view_layer) { int type; - RE_engine_register_pass(engine, scene, scene_layer, RE_PASSNAME_COMBINED, 4, "RGBA", SOCK_RGBA); + RE_engine_register_pass(engine, scene, view_layer, RE_PASSNAME_COMBINED, 4, "RGBA", SOCK_RGBA); #define CHECK_PASS(name, channels, chanid) \ - if (scene_layer->passflag & (SCE_PASS_ ## name)) { \ + if (view_layer->passflag & (SCE_PASS_ ## name)) { \ if (channels == 4) type = SOCK_RGBA; \ else if (channels == 3) type = SOCK_VECTOR; \ else type = SOCK_FLOAT; \ - RE_engine_register_pass(engine, scene, scene_layer, RE_PASSNAME_ ## name, channels, chanid, type); \ + RE_engine_register_pass(engine, scene, view_layer, RE_PASSNAME_ ## name, channels, chanid, type); \ } CHECK_PASS(Z, 1, "Z"); |