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:
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];