From 9c1da81a4c173437c1e556afde7b32eef4b0a47d Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 28 Jul 2020 18:26:56 +0200 Subject: Fix T54544: "Copy Materials to Selected" only works when materials are defined on the mesh. Build a temp matarray storing materials from obdata and source object (depending on slots 'allocation' of source object), and assign those to targets. Also remove limitation of 'using same obdata is forbidden', just never edit obdata materials in that case... Certainly not perfect, but already much better than existing code. --- source/blender/blenkernel/BKE_material.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/BKE_material.h') diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h index 225d966a51a..cae79326dda 100644 --- a/source/blender/blenkernel/BKE_material.h +++ b/source/blender/blenkernel/BKE_material.h @@ -84,7 +84,8 @@ void BKE_object_material_assign( void BKE_object_material_array_assign(struct Main *bmain, struct Object *ob, struct Material ***matar, - short totcol); + int totcol, + const bool to_object_only); short BKE_object_material_slot_find_index(struct Object *ob, struct Material *ma); bool BKE_object_material_slot_add(struct Main *bmain, struct Object *ob); -- cgit v1.2.3