Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2014-05-23 20:30:36 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2014-05-23 20:30:36 +0400
commitf5055d86887a2c139080f26ab0ba9a00cf077ef6 (patch)
treedc1eff40edd2de0d7bbfd50cc99d716d46c6ef87 /source/blender/editors/space_node/node_edit.c
parent5811076d0dd9df7f87837160c4eea168a0a1e256 (diff)
Some operation allowed to set invalid active scene render layer
Forbid this now and do tricks in the versioning code to repair corrupted files. Thanks to Pablo, Caminandes and Koro for discovering this bug!
Diffstat (limited to 'source/blender/editors/space_node/node_edit.c')
-rw-r--r--source/blender/editors/space_node/node_edit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index fc0c82faba8..5bbe0c1c229 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -695,7 +695,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_countlist(&scene->r.layers);
scene->r.actlay = 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);
}
}
}