X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=blender%2Fio_mspgl%2Fexport_object.py;h=8065c09ad4a2bac0219eb7ed2254b4c3dfcb6ab8;hb=44fc9b88ead11e7325bd193e4c853f8b10e9b175;hp=12b15b63c26586abe203629992782d594b266a64;hpb=912ae952489699769be43f90d4478263461964a4;p=libs%2Fgl.git diff --git a/blender/io_mspgl/export_object.py b/blender/io_mspgl/export_object.py index 12b15b63..8065c09a 100644 --- a/blender/io_mspgl/export_object.py +++ b/blender/io_mspgl/export_object.py @@ -1,3 +1,5 @@ +import os + def linear_to_srgb(l): if l<0.0031308: return 12.92*l @@ -10,6 +12,7 @@ class ObjectExporter: self.material_tex = False self.srgb_colors = True self.textures = "REF" + self.separate_mesh = False def export(self, context, out_file): from .outfile import open_output @@ -20,9 +23,16 @@ class ObjectExporter: for k, v in self.__dict__.items(): setattr(mesh_export, k, v) - out_file.begin("mesh") - mesh = mesh_export.export(context, out_file) - out_file.end() + if self.separate_mesh: + 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\"") + else: + out_file.begin("mesh") + mesh = mesh_export.export(context, out_file) + out_file.end() out_file.begin("technique") out_file.begin("pass", '""')