Commit: 559e116a36d91ed2d9abc39fd14b9c78d201e6ac
Author: Mike Erwin
Date:   Mon Sep 5 13:05:00 2016 -0400
Branches: blender-v2.78-release
https://developer.blender.org/rB559e116a36d91ed2d9abc39fd14b9c78d201e6ac

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.

===================================================================

M       source/blender/editors/space_view3d/drawobject.c

===================================================================

diff --git a/source/blender/editors/space_view3d/drawobject.c 
b/source/blender/editors/space_view3d/drawobject.c
index 4739057..6ae2229 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -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;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to