Fix bad usercount handling of materials in BKE_mesh_new_from_object().
authorBastien Montagne <montagne29@wanadoo.fr>
Tue, 30 Aug 2016 18:36:22 +0000 (20:36 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Tue, 30 Aug 2016 18:38:53 +0000 (20:38 +0200)
commita0cdebde115a7e9f5b217133432957f86539d29d
tree83390336de7c995d9f4f34e10a8a05105fd36076
parent7aedd0e6b08991ff6d35756e98ca393689722418
Fix bad usercount handling of materials in BKE_mesh_new_from_object().

Curves and meshes (when no modifier application required) would increase their material usercount twice.

Not sure how/why it worked in previous code, but with new, stricter ID handling we need more
careful check of ID 'ownership' handling.

Reported by Sergey over IRC, thanks.
source/blender/blenkernel/intern/mesh.c