]> git.tdb.fi Git - libs/gl.git/commitdiff
Compare materials when looking for object clones while exporting a scene
authorMikko Rasa <tdb@tdb.fi>
Tue, 13 Apr 2021 08:49:38 +0000 (11:49 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 13 Apr 2021 08:49:38 +0000 (11:49 +0300)
blender/io_mspgl/export_scene.py

index cd2bba8e3bb8b036a9b3ad0ea05295423d8a97d6..18cdcbca2404cea30f14b89f863e9aecef512c38 100644 (file)
@@ -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: