diff options
Diffstat (limited to 'source/blender/editors')
10 files changed, 109 insertions, 105 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 63c700c6eea..f5eadeab92a 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1958,25 +1958,26 @@ static size_t animdata_filter_ds_nodetree(bAnimContext *ac, ListBase *anim_data, static size_t animdata_filter_ds_linestyle(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Scene *sce, int filter_mode) { - SceneRenderLayer *srl; + SceneLayer *scene_layer; FreestyleLineSet *lineset; size_t items = 0; - for (srl = sce->r.layers.first; srl; srl = srl->next) { - for (lineset = srl->freestyleConfig.linesets.first; lineset; lineset = lineset->next) { + for (scene_layer = sce->render_layers.first; scene_layer; scene_layer = scene_layer->next) { + for (lineset = scene_layer->freestyle_config.linesets.first; lineset; lineset = lineset->next) { if (lineset->linestyle) { lineset->linestyle->id.tag |= LIB_TAG_DOIT; } } } - for (srl = sce->r.layers.first; srl; srl = srl->next) { + for (scene_layer = sce->render_layers.first; scene_layer; scene_layer = scene_layer->next) { /* skip render layers without Freestyle enabled */ - if (!(srl->layflag & SCE_LAY_FRS)) + if ((scene_layer->flag & SCENE_LAYER_FREESTYLE) == 0) { continue; - + } + /* loop over linesets defined in the render layer */ - for (lineset = srl->freestyleConfig.linesets.first; lineset; lineset = lineset->next) { + for (lineset = scene_layer->freestyle_config.linesets.first; lineset; lineset = lineset->next) { FreestyleLineStyle *linestyle = lineset->linestyle; ListBase tmp_data = {NULL, NULL}; size_t tmp_items = 0; diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 3f2951b2a3e..701227091b3 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -108,7 +108,6 @@ typedef struct RenderJob { */ Depsgraph *depsgraph; Render *re; - SceneRenderLayer *srl; struct Object *camera_override; int lay_override; bool v3d_override; @@ -261,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, SceneRenderLayer **srl) +static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **scene, SceneLayer **scene_layer) { /* single layer re-render */ if (RNA_struct_property_is_set(op->ptr, "scene")) { @@ -281,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")) { - SceneRenderLayer *rl; + SceneLayer *rl; char rl_name[RE_MAXNAME]; RNA_string_get(op->ptr, "layer", rl_name); - rl = (SceneRenderLayer *)BLI_findstring(&(*scene)->r.layers, rl_name, offsetof(SceneRenderLayer, name)); + rl = (SceneLayer *)BLI_findstring(&(*scene)->render_layers, rl_name, offsetof(SceneLayer, name)); if (rl) - *srl = rl; + *scene_layer = rl; } } @@ -296,9 +295,8 @@ 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 = CTX_data_scene_layer(C); + SceneLayer *scene_layer = NULL; Depsgraph *depsgraph = CTX_data_depsgraph(C); - SceneRenderLayer *srl = NULL; Render *re; Image *ima; View3D *v3d = CTX_wm_view3d(C); @@ -309,7 +307,10 @@ 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, &srl); + screen_render_scene_layer_set(op, mainp, &scene, &scene_layer); + if (scene_layer == NULL) { + scene_layer = CTX_data_scene_layer(C); + } 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"); @@ -339,7 +340,7 @@ 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, srl, camera_override, lay_override, scene->r.cfra, is_write_still); + RE_BlenderFrame(re, mainp, scene, scene_layer, camera_override, lay_override, scene->r.cfra, is_write_still); BLI_end_threaded_malloc(); RE_SetReports(re, NULL); @@ -616,7 +617,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->srl, rj->camera_override, rj->lay_override, rj->scene->r.cfra, rj->write_still); + 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_SetReports(rj->re, NULL); } @@ -669,7 +670,7 @@ static void render_endjob(void *rjv) /* potentially set by caller */ rj->scene->r.scemode &= ~R_NO_FRAME_UPDATE; - if (rj->srl) { + if (rj->scene_layer) { nodeUpdateID(rj->scene->nodetree, &rj->scene->id); WM_main_add_notifier(NC_NODE | NA_EDITED, rj->scene); } @@ -699,7 +700,7 @@ static void render_endjob(void *rjv) * engine API, so lets use simple and robust way for now * - sergey - */ - if (rj->scene->r.layers.first != rj->scene->r.layers.last || + if (rj->scene->render_layers.first != rj->scene->render_layers.last || rj->image_outdated) { void *lock; @@ -844,8 +845,8 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even { /* new render clears all callbacks */ Main *mainp; + SceneLayer *scene_layer = NULL; Scene *scene = CTX_data_scene(C); - SceneRenderLayer *srl = NULL; Render *re; wmJob *wm_job; RenderJob *rj; @@ -912,7 +913,10 @@ 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, &srl); + screen_render_scene_layer_set(op, mainp, &scene, &scene_layer); + if (scene_layer == NULL) { + scene_layer = CTX_data_scene_layer(C); + } if (RNA_struct_property_is_set(op->ptr, "layer")) jobflag |= WM_JOB_SUSPEND; @@ -922,10 +926,9 @@ 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 = CTX_data_scene_layer(C); + rj->scene_layer = scene_layer; /* TODO(sergey): Render engine should be using own depsgraph. */ rj->depsgraph = CTX_data_depsgraph(C); - rj->srl = srl; rj->camera_override = camera_override; rj->lay_override = 0; rj->anim = is_animation; @@ -1283,10 +1286,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->view_render, NULL, rp->ar->winx, rp->ar->winy, &cliprct); + 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); } else - RE_InitState(re, NULL, &rdata, &rp->scene->view_render, NULL, rp->ar->winx, rp->ar->winy, NULL); + 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); } if (orth) diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index d436c562f19..e0193a0caea 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -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, view_render, NULL, sizex, sizey, NULL); + RE_InitState(oglrender->re, NULL, &scene->r, &scene->render_layers, scene->active_layer, view_render, NULL, sizex, sizey, NULL); /* create render views */ screen_opengl_views_setup(oglrender); diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 323b17797a0..a98751176fc 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -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); - SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); + SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); - BKE_freestyle_module_add(&srl->freestyleConfig); + BKE_freestyle_module_add(&scene_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); - SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); + SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); PointerRNA ptr = CTX_data_pointer_get_type(C, "freestyle_module", &RNA_FreestyleModuleSettings); FreestyleModuleConfig *module = ptr.data; - BKE_freestyle_module_delete(&srl->freestyleConfig, module); + BKE_freestyle_module_delete(&scene_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); - SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); + SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_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(&srl->freestyleConfig, module, dir)) { + if (BKE_freestyle_module_move(&scene_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); - SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); + SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); - BKE_freestyle_lineset_add(bmain, &srl->freestyleConfig, NULL); + BKE_freestyle_lineset_add(bmain, &scene_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); - SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); + SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); - if (!srl) { + if (!scene_layer) { return false; } - return BKE_freestyle_lineset_get_active(&srl->freestyleConfig) != NULL; + return BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config) != NULL; } static int freestyle_lineset_copy_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); - SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); + SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); - FRS_copy_active_lineset(&srl->freestyleConfig); + FRS_copy_active_lineset(&scene_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); - SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); + SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); - FRS_paste_active_lineset(&srl->freestyleConfig); + FRS_paste_active_lineset(&scene_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); - SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); + SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); - FRS_delete_active_lineset(&srl->freestyleConfig); + FRS_delete_active_lineset(&scene_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); - SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); + SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); int dir = RNA_enum_get(op->ptr, "direction"); - if (FRS_move_active_lineset(&srl->freestyleConfig, dir)) { + if (FRS_move_active_lineset(&scene_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); - SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); - FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig); + SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_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); - SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); - FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig); + SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_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); - SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); - FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig); + SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_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); - SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); - FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig); + SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_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); - SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); - FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig); + SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_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); - SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); - FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig); + SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_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); - SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); - FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig); + SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_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); - SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); - FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig); + SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_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/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 8aa4e674d11..392efd03ee1 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -561,7 +561,7 @@ static int buttons_context_path_texture(const bContext *C, ButsContextPath *path static bool buttons_context_linestyle_pinnable(const bContext *C) { Scene *scene = CTX_data_scene(C); - SceneRenderLayer *actsrl; + SceneLayer *active_scene_layer; FreestyleConfig *config; SpaceButs *sbuts; @@ -570,8 +570,8 @@ static bool buttons_context_linestyle_pinnable(const bContext *C) return false; } /* if Freestyle is not in the Parameter Editor mode */ - actsrl = BLI_findlink(&scene->r.layers, scene->r.actlay); - config = &actsrl->freestyleConfig; + active_scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + config = &active_scene_layer->freestyle_config; if (config->mode != FREESTYLE_CONTROL_EDITOR_MODE) { return false; } diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c index ed2a256912e..8a23c762b8c 100644 --- a/source/blender/editors/space_buttons/buttons_texture.c +++ b/source/blender/editors/space_buttons/buttons_texture.c @@ -109,14 +109,14 @@ bool ED_texture_context_check_linestyle(const bContext *C) { #ifdef WITH_FREESTYLE Scene *scene = CTX_data_scene(C); - SceneRenderLayer *actsrl; + SceneLayer *active_render_layer; FreestyleConfig *config; FreestyleLineSet *lineset; FreestyleLineStyle *linestyle; if (scene && (scene->r.mode & R_EDGE_FRS)) { - actsrl = BLI_findlink(&scene->r.layers, scene->r.actlay); - config = &actsrl->freestyleConfig; + active_render_layer = BLI_findlink(&scene->render_layers, scene->active_layer); + config = &active_render_layer->freestyle_config; if (config->mode == FREESTYLE_CONTROL_EDITOR_MODE) { lineset = BKE_freestyle_lineset_get_active(config); if (lineset) { diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index a9bc58661a0..5a682338eee 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -700,12 +700,12 @@ void ED_node_set_active(Main *bmain, bNodeTree *ntree, bNode *node) for (scene = bmain->scene.first; scene; scene = scene->id.next) { if (scene->nodetree && scene->use_nodes && ntreeHasTree(scene->nodetree, ntree)) { if (node->id == NULL || node->id == (ID *)scene) { - int num_layers = BLI_listbase_count(&scene->r.layers); - scene->r.actlay = node->custom1; + int num_layers = BLI_listbase_count(&scene->render_layers); + scene->active_layer = node->custom1; /* Clamp the value, because it might have come from a different * scene which could have more render layers than new one. */ - scene->r.actlay = min_ff(scene->r.actlay, num_layers - 1); + scene->active_layer = min_ff(scene->active_layer, num_layers - 1); } } } @@ -1366,13 +1366,13 @@ int node_render_changed_exec(bContext *C, wmOperator *UNUSED(op)) } } if (node) { - SceneRenderLayer *srl = BLI_findlink(&sce->r.layers, node->custom1); + SceneLayer *scene_layer = BLI_findlink(&sce->render_layers, node->custom1); - if (srl) { + if (scene_layer) { PointerRNA op_ptr; WM_operator_properties_create(&op_ptr, "RENDER_OT_render"); - RNA_string_set(&op_ptr, "layer", srl->name); + RNA_string_set(&op_ptr, "layer", scene_layer->name); RNA_string_set(&op_ptr, "scene", sce->id.name + 2); /* to keep keypositions */ diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 79fded30782..c9e2a040af4 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -464,7 +464,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar if (tselem->type == TSE_R_LAYER) { UI_block_emboss_set(block, UI_EMBOSS_NONE); - bt = uiDefIconButBitI(block, UI_BTYPE_ICON_TOGGLE_N, SCE_LAY_DISABLE, 0, ICON_CHECKBOX_HLT - 1, + bt = uiDefIconButBitI(block, UI_BTYPE_ICON_TOGGLE, SCENE_LAYER_RENDER, 0, ICON_CHECKBOX_HLT - 1, (int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX), te->ys, UI_UNIT_X, UI_UNIT_Y, te->directdata, 0, 0, 0, 0, TIP_("Render this RenderLayer")); UI_but_func_set(bt, restrictbutton_r_lay_cb, tselem->id, NULL); diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 670be7611e4..f2aec1cfa52 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -85,11 +85,11 @@ static eOLDrawState tree_element_active_renderlayer( sce = (Scene *)tselem->id; if (set != OL_SETSEL_NONE) { - sce->r.actlay = tselem->nr; + sce->active_layer = tselem->nr; WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, sce); } else { - return sce->r.actlay == tselem->nr; + return sce->active_layer == tselem->nr; } return OL_DRAWSEL_NONE; } diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 8c17522103d..eda4faab93f 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -234,7 +234,7 @@ static void outliner_add_bone(SpaceOops *soops, ListBase *lb, ID *id, Bone *curB #define LOG2I(x) (int)(log(x) / M_LN2) -static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, SceneRenderLayer *srl) +static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, SceneLayer *scene_layer) { TreeStoreElem *tselem = NULL; TreeElement *te = NULL; @@ -244,7 +244,7 @@ static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, Sc te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_COMBINED)); te->name = IFACE_("Combined"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; /* save cpu cycles, but we add the first to invoke an open/close triangle */ tselem = TREESTORE(tenla); @@ -253,71 +253,71 @@ static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, Sc te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_Z)); te->name = IFACE_("Z"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_VECTOR)); te->name = IFACE_("Vector"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_NORMAL)); te->name = IFACE_("Normal"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_UV)); te->name = IFACE_("UV"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_MIST)); te->name = IFACE_("Mist"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_INDEXOB)); te->name = IFACE_("Index Object"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_INDEXMA)); te->name = IFACE_("Index Material"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_RGBA)); te->name = IFACE_("Color"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_DIFFUSE)); te->name = IFACE_("Diffuse"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_SPEC)); te->name = IFACE_("Specular"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_SHADOW)); te->name = IFACE_("Shadow"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_AO)); te->name = IFACE_("AO"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_REFLECT)); te->name = IFACE_("Reflection"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_REFRACT)); te->name = IFACE_("Refraction"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_INDIRECT)); te->name = IFACE_("Indirect"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_ENVIRONMENT)); te->name = IFACE_("Environment"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_EMIT)); te->name = IFACE_("Emit"); - te->directdata = &srl->passflag; + te->directdata = &scene_layer->passflag; } #undef LOG2I @@ -332,19 +332,19 @@ static bool outliner_animdata_test(AnimData *adt) #ifdef WITH_FREESTYLE static void outliner_add_line_styles(SpaceOops *soops, ListBase *lb, Scene *sce, TreeElement *te) { - SceneRenderLayer *srl; + SceneLayer *scene_layer; FreestyleLineSet *lineset; - for (srl = sce->r.layers.first; srl; srl = srl->next) { - for (lineset = srl->freestyleConfig.linesets.first; lineset; lineset = lineset->next) { + for (scene_layer = sce->render_layers.first; scene_layer; scene_layer = scene_layer->next) { + for (lineset = scene_layer->freestyle_config.linesets.first; lineset; lineset = lineset->next) { FreestyleLineStyle *linestyle = lineset->linestyle; if (linestyle) { linestyle->id.tag |= LIB_TAG_DOIT; } } } - for (srl = sce->r.layers.first; srl; srl = srl->next) { - for (lineset = srl->freestyleConfig.linesets.first; lineset; lineset = lineset->next) { + for (scene_layer = sce->render_layers.first; scene_layer; scene_layer = scene_layer->next) { + for (lineset = scene_layer->freestyle_config.linesets.first; lineset; lineset = lineset->next) { FreestyleLineStyle *linestyle = lineset->linestyle; if (linestyle) { if (!(linestyle->id.tag & LIB_TAG_DOIT)) @@ -359,16 +359,16 @@ static void outliner_add_line_styles(SpaceOops *soops, ListBase *lb, Scene *sce, static void outliner_add_scene_contents(SpaceOops *soops, ListBase *lb, Scene *sce, TreeElement *te) { - SceneRenderLayer *srl; + SceneLayer *scene_layer; TreeElement *tenla = outliner_add_element(soops, lb, sce, te, TSE_R_LAYER_BASE, 0); int a; tenla->name = IFACE_("RenderLayers"); - for (a = 0, srl = sce->r.layers.first; srl; srl = srl->next, a++) { + for (a = 0, scene_layer = sce->render_layers.first; scene_layer; scene_layer = scene_layer->next, a++) { TreeElement *tenlay = outliner_add_element(soops, &tenla->subtree, sce, te, TSE_R_LAYER, a); - tenlay->name = srl->name; - tenlay->directdata = &srl->layflag; - outliner_add_passes(soops, tenlay, &sce->id, srl); + tenlay->name = scene_layer->name; + tenlay->directdata = &scene_layer->flag; + outliner_add_passes(soops, tenlay, &sce->id, scene_layer); } // TODO: move this to the front? |