Further work to fix T38726: signal viewport to update when adding/removing render layers.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D346
This commit is contained in:
2014-02-26 18:35:55 +01:00
committed by Brecht Van Lommel
parent 3ca606ffc3
commit 49e8cfd809
2 changed files with 4 additions and 0 deletions

View File

@@ -541,6 +541,7 @@ static int render_layer_add_exec(bContext *C, wmOperator *UNUSED(op))
BKE_scene_add_render_layer(scene, NULL);
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);
return OPERATOR_FINISHED;
@@ -568,6 +569,7 @@ static int render_layer_remove_exec(bContext *C, wmOperator *UNUSED(op))
if (!BKE_scene_remove_render_layer(CTX_data_main(C), scene, rl))
return OPERATOR_CANCELLED;
DAG_id_tag_update(&scene->id, 0);
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
return OPERATOR_FINISHED;

View File

@@ -1056,6 +1056,7 @@ static SceneRenderLayer *rna_RenderLayer_new(ID *id, RenderData *UNUSED(rd), con
Scene *scene = (Scene *)id;
SceneRenderLayer *srl = BKE_scene_add_render_layer(scene, name);
DAG_id_tag_update(&scene->id, 0);
WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL);
return srl;
@@ -1075,6 +1076,7 @@ static void rna_RenderLayer_remove(ID *id, RenderData *UNUSED(rd), Main *bmain,
RNA_POINTER_INVALIDATE(srl_ptr);
DAG_id_tag_update(&scene->id, 0);
WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL);
}