Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/render/render_shading.c
| Show First 20 Lines • Show All 535 Lines • ▼ Show 20 Lines | |||||
| static int render_layer_add_exec(bContext *C, wmOperator *UNUSED(op)) | static int render_layer_add_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| BKE_scene_add_render_layer(scene, NULL); | BKE_scene_add_render_layer(scene, NULL); | ||||
| scene->r.actlay = BLI_countlist(&scene->r.layers) - 1; | scene->r.actlay = BLI_countlist(&scene->r.layers) - 1; | ||||
| DAG_id_tag_update(&scene->id, 0); | |||||
| WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); | WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void SCENE_OT_render_layer_add(wmOperatorType *ot) | void SCENE_OT_render_layer_add(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| Show All 11 Lines | |||||
| static int render_layer_remove_exec(bContext *C, wmOperator *UNUSED(op)) | static int render_layer_remove_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| SceneRenderLayer *rl = BLI_findlink(&scene->r.layers, scene->r.actlay); | SceneRenderLayer *rl = BLI_findlink(&scene->r.layers, scene->r.actlay); | ||||
| if (!BKE_scene_remove_render_layer(CTX_data_main(C), scene, rl)) | if (!BKE_scene_remove_render_layer(CTX_data_main(C), scene, rl)) | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| DAG_id_tag_update(&scene->id, 0); | |||||
| WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); | WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void SCENE_OT_render_layer_remove(wmOperatorType *ot) | void SCENE_OT_render_layer_remove(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ▲ Show 20 Lines • Show All 1,135 Lines • Show Last 20 Lines | |||||