X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=blender%2Fio_mspgl%2Fexport_object.py;h=6cc0be31bf93217d90014c83e8ef95311615757b;hp=5b81ace45e6cce1a01416e3acb49f4e51d331a78;hb=42ae18b7a9dc13a72bf421e564f02829d4bdd5be;hpb=b4b7ee4b3b767b8cc097ffe8205c71f3afbe5d39 diff --git a/blender/io_mspgl/export_object.py b/blender/io_mspgl/export_object.py index 5b81ace4..6cc0be31 100644 --- a/blender/io_mspgl/export_object.py +++ b/blender/io_mspgl/export_object.py @@ -80,13 +80,8 @@ class ObjectExporter: numbers[ext] = n+1 for r in refs: - with open(os.path.join(path, r.name), "w") as out_file: - for s in r.statements: - s.write_to_file(out_file) - - with open(out_fn, "w") as out_file: - for s in obj_res.statements: - s.write_to_file(out_file) + r.write_to_file(os.path.join(path, r.name)) + obj_res.write_to_file(out_fn) def export_object_resources(self, context, obj, resources, progress, material_maps=None): if material_maps is None: @@ -149,7 +144,7 @@ class ObjectExporter: lods = self.collect_object_lods(obj) from .datafile import Resource, Statement - obj_res = Resource(obj.name+".object") + obj_res = Resource(obj.name+".object", "object") statements = obj_res.statements center, radius = self.compute_bounding_sphere(obj) @@ -202,7 +197,7 @@ class ObjectExporter: def export_stub_technique(self): from .datafile import Resource, Statement - tech_res = Resource("stub.tech") + tech_res = Resource("stub.tech", "technique") pass_st = Statement("pass", "") tech_res.statements.append(pass_st) mat_st = Statement("material")