From: Mikko Rasa Date: Tue, 13 Apr 2021 08:49:38 +0000 (+0300) Subject: Compare materials when looking for object clones while exporting a scene X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=cf528e58cbeccceed8a4dc6a9eebd8016e372765 Compare materials when looking for object clones while exporting a scene --- diff --git a/blender/io_mspgl/export_scene.py b/blender/io_mspgl/export_scene.py index cd2bba8e..18cdcbca 100644 --- a/blender/io_mspgl/export_scene.py +++ b/blender/io_mspgl/export_scene.py @@ -35,16 +35,15 @@ class SceneExporter: continue clones = [o] - if not any(s.link=="OBJECT" for s in o.material_slots): - for u in objs: - if u is o: - continue - if u.data.name!=o.data.name: - continue - if any(s.link=="OBJECT" for s in u.material_slots): - continue - - clones.append(u) + for u in objs: + if u is o: + continue + if u.data.name!=o.data.name: + continue + if any(m1.name!=m2.name for m1, m2 in zip(o.material_slots, u.material_slots)): + continue + + clones.append(u) prefix = o.name for c in clones: