From cf528e58cbeccceed8a4dc6a9eebd8016e372765 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 13 Apr 2021 11:49:38 +0300 Subject: [PATCH] Compare materials when looking for object clones while exporting a scene --- blender/io_mspgl/export_scene.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) 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: -- 2.43.0