X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=blender%2Fio_mspgl%2Fexport.py;h=238f8c4d1725bb9f547632238e1ed488c76b2486;hb=6c881bc1ee3c0af5c1bb4b3794dcb23ba096ac12;hp=190069c4f3caa961ed3512ec191b9366f7238be4;hpb=308dc6b8f5ee1aa3bb8f205e2ed6464749eebbe5;p=libs%2Fgl.git diff --git a/blender/io_mspgl/export.py b/blender/io_mspgl/export.py index 190069c4..238f8c4d 100644 --- a/blender/io_mspgl/export.py +++ b/blender/io_mspgl/export.py @@ -1,15 +1,13 @@ import os -import itertools class DataExporter: def export_to_file(self, ctx, out_fn, *, collection=False, shared_resources=False): objects = context.context.selected_objects resources = {} - material_atlases = {} task = ctx.task("Exporting resources", 1.0) - dummy_res = self.export_resources(task, objects, resources, material_atlases) + dummy_res = self.export_resources(task, objects, resources) path, base = os.path.split(out_fn) base, ext = os.path.splitext(base) @@ -33,10 +31,7 @@ class DataExporter: for r in refs: r.write_to_file(os.path.join(path, r.name)) - def export_resources(self, ctx, objects, resources, material_atlases): - if material_atlases is None: - material_atlases = {} - + def export_resources(self, ctx, objects, resources): object_exporter = None camera_exporter = None armature_exporter = None @@ -56,7 +51,7 @@ class DataExporter: if not object_exporter: from .export_object import ObjectExporter object_exporter = ObjectExporter() - object_exporter.export_object_resources(task, obj, resources, material_atlases) + object_exporter.export_object_resources(task, obj, resources) res = object_exporter.export_object(obj, resources) elif obj.type=='CAMERA': res_name = obj.name+".camera" @@ -88,7 +83,7 @@ class DataExporter: class ProjectExporter: def export_to_directory(self, ctx, out_dir): - from .scene import create_scene_chain + from .scene import create_scene, create_scene_chain task = ctx.task("Preparing scenes", 0.0) task.set_slices(len(ctx.context.blend_data.scenes)) @@ -110,7 +105,7 @@ class ProjectExporter: all_objects = [] for s in scenes.values(): - all_objects += s.prototypes + all_objects += [p.object for p in s.prototypes] all_objects += s.lights if s.camera: all_objects.append(s.camera) @@ -133,7 +128,7 @@ class ProjectExporter: task = ctx.task("Exporting resources", 1.0) resources = {} - dummy_res = data_exporter.export_resources(task, all_objects, resources, None) + dummy_res = data_exporter.export_resources(task, all_objects, resources) task = ctx.task("Exporting scenes", 1.0) for s in ordered_scenes: