[Bf-blender-cvs] [7aabe3f66ca] blender2.8: Fix renderlayers UI removing the wrong renderlayer

Dalai Felinto noreply at git.blender.org
Mon Oct 30 22:13:20 CET 2017


Commit: 7aabe3f66cae3c57ca37842acfd7d002dcae023f
Author: Dalai Felinto
Date:   Mon Oct 30 19:11:24 2017 -0200
Branches: blender2.8
https://developer.blender.org/rB7aabe3f66cae3c57ca37842acfd7d002dcae023f

Fix renderlayers UI removing the wrong renderlayer

Bug introduced on 1c4c28872721 (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.

===================================================================

M	source/blender/editors/render/render_shading.c

===================================================================

diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index ef436c44b74..323b17797a0 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -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;
 	}



More information about the Bf-blender-cvs mailing list