Fix cast shadows (material option) in the viewport

Fix cast shadows options (in material tab) not working in the viewport.
An off-by-one error. See D2194 for more.

Committing for Ulysse Martin (youle) who found & fixed this.
This commit is contained in:
Mike Erwin 2016-09-05 13:05:00 -04:00 committed by Sergey Sharybin
parent 989ca313be
commit 559e116a36
1 changed files with 1 additions and 1 deletions

View File

@ -4227,7 +4227,7 @@ static bool draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3
/* If we are drawing shadows and any of the materials don't cast a shadow,
* then don't draw the object */
if (v3d->flag2 & V3D_RENDER_SHADOW) {
for (int i = 0; i < ob->totcol; ++i) {
for (int i = 1; i <= ob->totcol; ++i) {
Material *ma = give_current_material(ob, i);
if (ma && !(ma->mode2 & MA_CASTSHADOW)) {
return true;