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:
authorCampbell Barton <ideasman42@gmail.com>2016-07-20 23:00:58 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-07-20 23:03:02 +0300
commit5ef1821a0fcba14a29dd11e44b2a4180fd6ffe14 (patch)
treec7c1c5eb07defab530fe226e8a083808eb94848f /source/blender/blenkernel/intern/material.c
parente0f16bdcc2892036aadb56ced343045822070aaa (diff)
Fix copy-materials resetting objects material indices
Diffstat (limited to 'source/blender/blenkernel/intern/material.c')
-rw-r--r--source/blender/blenkernel/intern/material.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 0387a635c46..340eab83414 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -874,7 +874,11 @@ void assign_matarar(struct Object *ob, struct Material ***matar, short totcol)
int actcol_orig = ob->actcol;
short i;
- while (BKE_object_material_slot_remove(ob)) {}
+ while ((ob->totcol > totcol) &&
+ BKE_object_material_slot_remove(ob))
+ {
+ /* pass */
+ }
/* now we have the right number of slots */
for (i = 0; i < totcol; i++)