diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-07-20 23:00:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-07-20 23:03:02 +0300 |
commit | 5ef1821a0fcba14a29dd11e44b2a4180fd6ffe14 (patch) | |
tree | c7c1c5eb07defab530fe226e8a083808eb94848f /source | |
parent | e0f16bdcc2892036aadb56ced343045822070aaa (diff) |
Fix copy-materials resetting objects material indices
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 6 |
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++) |