- for i, o in enumerate(unique_objects):
- obj_out = open_output(os.path.join(res_dir, o.name+".object"))
- progress.push_task(o.name, i/len(objs), (i+1)/len(objs))
- object_export.export(context, obj_out, [o], progress)
- progress.pop_task()
+ for r in refs:
+ r.write_to_file(os.path.join(res_dir, r.name))
+
+ scene_res.write_to_file(out_fn)
+
+ def export_scene_resources(self, context, objs, resources, progress):
+ from .export_object import ObjectExporter
+ object_export = ObjectExporter()
+ object_export.single_file = False
+
+ material_atlass = {}
+
+ 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)
+ obj_name = o.name+".object"
+ resources[obj_name] = object_export.export_object(context, o, progress, resources=resources)
+ progress.pop_task()
+
+ def export_scene(self, context, objs, progress, *, prototypes, resources):
+ from .datafile import Resource, Statement
+ scene_res = Resource("scene.scene", "scene")