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:
parent
989ca313be
commit
559e116a36
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue