diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-05-23 20:30:36 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-05-23 20:30:36 +0400 |
commit | f5055d86887a2c139080f26ab0ba9a00cf077ef6 (patch) | |
tree | dc1eff40edd2de0d7bbfd50cc99d716d46c6ef87 /source/blender/blenloader | |
parent | 5811076d0dd9df7f87837160c4eea168a0a1e256 (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/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_270.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 7e058ae80f7..00fcd2d7591 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -288,4 +288,12 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) linestyle->texstep = 1.0; } } + + { + Scene *scene; + for (scene = main->scene.first; scene; scene = scene->id.next) { + int num_layers = BLI_countlist(&scene->r.layers); + scene->r.actlay = min_ff(scene->r.actlay, num_layers - 1); + } + } } |