Fix copy-materials resetting objects material indices

This commit is contained in:
Campbell Barton 2016-07-21 06:00:58 +10:00
parent e0f16bdcc2
commit 5ef1821a0f
1 changed files with 5 additions and 1 deletions

View File

@ -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++)