[Bf-blender-cvs] [8f50969] master: Fix cast shadows (material option) in the viewport

Mike Erwin noreply at git.blender.org
Mon Sep 5 19:05:56 CEST 2016


Commit: 8f509698d796f04b149d254542f39f1f59b33465
Author: Mike Erwin
Date:   Mon Sep 5 13:05:00 2016 -0400
Branches: master
https://developer.blender.org/rB8f509698d796f04b149d254542f39f1f59b33465

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;




More information about the Bf-blender-cvs mailing list