diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-08-14 15:10:47 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-08-14 15:10:47 +0300 |
commit | 1b5383854811f3aab842c9f10693fec57e28b07f (patch) | |
tree | ff25499fea46a64a3becc35eac0bd1f8e54d80a3 /source/blender/blenkernel | |
parent | 1f78e8607033f64d2c9633517d3b921c61ff431c (diff) | |
parent | 6eb5b418eee8cb26ac0e3a8bb70cbaf706be4e4d (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 41c23c46c44..b4060d6e60a 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1246,6 +1246,12 @@ void BKE_object_copy_data(Main *bmain, Object *ob_dst, const Object *ob_src, con ob_dst->matbits = MEM_dupallocN(ob_src->matbits); ob_dst->totcol = ob_src->totcol; } + else if (ob_dst->mat != NULL || ob_dst->matbits != NULL) { + /* This shall not be needed, but better be safe than sorry. */ + BLI_assert(!"Object copy: non-NULL material pointers with zero counter, should not happen."); + ob_dst->mat = NULL; + ob_dst->matbits = NULL; + } if (ob_src->iuser) ob_dst->iuser = MEM_dupallocN(ob_src->iuser); |