From e0cf86a9e219dcd71e5d67b8f2999d41e7f8c492 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Fri, 26 Dec 2014 20:06:56 +0100 Subject: Fix T43010 regression in material setting. Caused by own fix for another display case. Shoud be safe for 2.73 final. --- source/blender/blenkernel/intern/material.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/blenkernel/intern/material.c') diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 319e6271265..83800a3fb2f 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -681,16 +681,16 @@ Material *give_current_material(Object *ob, short act) /* if object cannot have material, (totcolp == NULL) */ totcolp = give_totcolp(ob); if (totcolp == NULL || ob->totcol == 0) return NULL; - - if (act < 0) { - printf("Negative material index!\n"); - } - + /* return NULL for invalid 'act', can happen for mesh face indices */ if (act > ob->totcol) return NULL; - else if (act <= 0) + else if (act <= 0) { + if (act < 0) { + printf("Negative material index!\n"); + } return NULL; + } if (ob->matbits && ob->matbits[act - 1]) { /* in object */ ma = ob->mat[act - 1]; -- cgit v1.2.3