diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 82dae1da498..8283490226d 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1059,7 +1059,8 @@ static int rna_RenderSettings_active_layer_index_get(PointerRNA *ptr) static void rna_RenderSettings_active_layer_index_set(PointerRNA *ptr, int value) { RenderData *rd = (RenderData *)ptr->data; - rd->actlay = value; + int num_layers = BLI_countlist(&rd->layers); + rd->actlay = min_ff(value, num_layers - 1); } static void rna_RenderSettings_active_layer_index_range(PointerRNA *ptr, int *min, int *max, |