X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=blender%2Fio_mspgl%2Fexport_object.py;h=d89afd05df667fb7c26d648a167bde38cc7ff8f8;hb=47abe7c9e1633ca65f910a4db340724117a6f6e5;hp=7b9ee6a44cfb2c8eb888c237b7e1579e358c1fff;hpb=1bad86b461abd4fe2a1cb1c6c5685adf5db13935;p=libs%2Fgl.git diff --git a/blender/io_mspgl/export_object.py b/blender/io_mspgl/export_object.py index 7b9ee6a4..d89afd05 100644 --- a/blender/io_mspgl/export_object.py +++ b/blender/io_mspgl/export_object.py @@ -17,8 +17,11 @@ class ObjectExporter: self.external_tech = True self.shared_tech = True - def export(self, context, out_file): - obj = context.active_object + def export(self, context, out_file, objs=None): + if objs is None: + obj = context.active_object + else: + obj = objs[0] from .outfile import open_output out_file = open_output(out_file) @@ -32,11 +35,11 @@ class ObjectExporter: path, base = os.path.split(out_file.filename) base, ext = os.path.splitext(base) mesh_out = open_output(os.path.join(path, base+".mesh")) - mesh = mesh_export.export(context, mesh_out) - out_file.write("mesh", "\""+base+".mesh\"") + mesh = mesh_export.export(context, mesh_out, objs) + out_file.write("mesh", '"{}.mesh"'.format(base)) else: out_file.begin("mesh") - mesh = mesh_export.export(context, out_file) + mesh = mesh_export.export(context, out_file, objs) out_file.end() if self.external_tech and obj.technique: