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-08-29 01:26:52 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-08-29 01:26:52 +0400
commitf823ea1ac43f9e837b522aedb3e98cc52c3c38b7 (patch)
treebd92078a5c4a9c0092be9fbc8175e36e3319bd7d /source/blender/blenkernel/intern/material.c
parentd1c91016429e81aa96f4ff64da773deec8f060ee (diff)
Solve another case of invalid indices.
Diffstat (limited to 'source/blender/blenkernel/intern/material.c')
-rw-r--r--source/blender/blenkernel/intern/material.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 8ccdb8a3223..574d4580350 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -1393,9 +1393,16 @@ void BKE_texpaint_slot_refresh_cache(Scene *scene, Material *ma)
}
}
}
+ else {
+ ma->paint_active_slot = 0;
+ ma->paint_clone_slot = 0;
+ return;
+ }
+
ma->tot_slots = count;
+
if (ma->paint_active_slot >= count) {
ma->paint_active_slot = count - 1;
}