Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-12-26 22:06:56 +0300
committerAntony Riakiotakis <kalast@gmail.com>2014-12-26 22:06:56 +0300
commite0cf86a9e219dcd71e5d67b8f2999d41e7f8c492 (patch)
tree4ad43a5acdac8f6f24fa26b123db5d92c49874e6 /source/blender/blenkernel/intern/material.c
parentfd4720204399e16032574159699d5a26a250e6d5 (diff)
Fix T43010 regression in material setting.
Caused by own fix for another display case. Shoud be safe for 2.73 final.
Diffstat (limited to 'source/blender/blenkernel/intern/material.c')
-rw-r--r--source/blender/blenkernel/intern/material.c12
1 files changed, 6 insertions, 6 deletions
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];