object_prototypes = {}
unique_objects = []
+ export_names = {}
for o in objs:
if o.name in object_prototypes:
continue
clones.append(u)
+ prefix = o.name
+ for c in clones:
+ for i in range(min(len(c.name), len(prefix))):
+ if c.name[i]!=prefix[i]:
+ prefix = prefix[:i]
+ break
+
+ if prefix:
+ export_names[o.name+".object"] = prefix.strip(" .")+".object"
+
unique_objects.append(o)
for c in clones:
object_prototypes[c.name] = o
resources = {}
self.export_scene_resources(context, unique_objects, resources, progress)
+ for n, r in resources.items():
+ if r.name in export_names:
+ r.name = export_names[r.name]
scene_res = self.export_scene(context, objs, progress, prototypes=object_prototypes, resources=resources)
refs = scene_res.collect_references()