diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-01-04 20:57:48 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-01-04 20:57:48 +0300 |
commit | a9e3ac906e23dc72b8af1b07a25286ed0a6b0bcb (patch) | |
tree | 0fff63db23ebb4c99c6af4b05cfcd723d290bde1 /source/blender/blenkernel/intern/material.c | |
parent | 205978a489276d2b9450be77cdfcb5f987830d06 (diff) | |
parent | 95d83b9b23e4aa8158e20fc94ec68b793c4bb87a (diff) |
Merge remote-tracking branch 'origin/master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern/material.c')
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 585567b6665..df8a2268100 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -1159,7 +1159,6 @@ bool material_in_material(Material *parmat, Material *mat) bool BKE_object_material_slot_remove(Object *ob) { Material *mao, ***matarar; - Object *obt; short *totcolp; short a, actcol; @@ -1207,11 +1206,13 @@ bool BKE_object_material_slot_remove(Object *ob) } actcol = ob->actcol; - obt = G.main->object.first; - while (obt) { - + + for (Object *obt = G.main->object.first; obt; obt = obt->id.next) { if (obt->data == ob->data) { - + /* Can happen when object material lists are used, see: T52953 */ + if (actcol > obt->totcol) { + continue; + } /* WATCH IT: do not use actcol from ob or from obt (can become zero) */ mao = obt->mat[actcol - 1]; if (mao) @@ -1231,7 +1232,6 @@ bool BKE_object_material_slot_remove(Object *ob) obt->matbits = NULL; } } - obt = obt->id.next; } /* check indices from mesh */ |