X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=blender%2Fio_mspgl%2Fexport_scene.py;h=18cdcbca2404cea30f14b89f863e9aecef512c38;hb=cf528e58cbeccceed8a4dc6a9eebd8016e372765;hp=16435e8f1b487ea089fad5edcdc42092709c677e;hpb=888bbef1f510eece3b37d7a0022d2757bf3b085d;p=libs%2Fgl.git diff --git a/blender/io_mspgl/export_scene.py b/blender/io_mspgl/export_scene.py index 16435e8f..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 + 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) + clones.append(u) prefix = o.name for c in clones: @@ -92,11 +91,11 @@ class SceneExporter: object_export = ObjectExporter() object_export.single_file = False - material_atlass = {} + material_atlases = {} for i, o in enumerate(objs): progress.push_task_slice(o.name, i, len(objs)) - object_export.export_object_resources(context, o, resources, progress, material_atlass=material_atlass) + object_export.export_object_resources(context, o, resources, progress, material_atlases=material_atlases) obj_name = o.name+".object" resources[obj_name] = object_export.export_object(context, o, progress, resources=resources) progress.pop_task()