Fix renderlayers UI removing the wrong renderlayer

Bug introduced on 1c4c288727 (well technically in b48694639a).
We should not remove the renderlayer from the context, but instead the one that
is active from scene.

That said, the UI should make a distinction between the scene active render layer
and the one that is active in the UI (and that should be the one used when
removing it).

But for now this is at least more consistent for the users.
This commit is contained in:
Dalai Felinto 2017-10-30 19:11:24 -02:00
parent b7e45b515c
commit 7aabe3f66c
1 changed files with 2 additions and 2 deletions

View File

@ -656,9 +656,9 @@ static int render_layer_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
SceneLayer *sl = CTX_data_scene_layer(C);
SceneLayer *scene_layer = BKE_scene_layer_from_scene_get(scene);
if (!ED_scene_render_layer_delete(bmain, scene, sl, NULL)) {
if (!ED_scene_render_layer_delete(bmain, scene, scene_layer, NULL)) {
return OPERATOR_CANCELLED;
}