]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/export_object.py
Remove some rarely-used export settings
[libs/gl.git] / blender / io_mspgl / export_object.py
index 541572f5da9c309d047215d1e6f2f286147d48bd..70109753518b14723001048a4de275f5642e343f 100644 (file)
@@ -4,13 +4,9 @@ import mathutils
 class ObjectExporter:
        def __init__(self):
                self.show_progress = True
-               self.use_strips = True
-               self.use_degen_tris = False
-               self.use_textures = True
                self.export_all = False
                self.collection = False
                self.shared_resources = True
-               self.export_lods = True
 
        def compute_bounding_sphere(self, obj):
                p1 = max(((v.co, v.co.length) for v in obj.data.vertices), key=lambda x:x[1])[0]
@@ -27,25 +23,21 @@ class ObjectExporter:
 
        def collect_object_lods(self, obj):
                lods = [obj]
-               if self.export_lods:
-                       lods += sorted([c for c in obj.children if c.lod_for_parent], key=(lambda l: l.lod_index))
-                       for i, l in enumerate(lods):
-                               if i>0 and l.lod_index!=i:
-                                       raise Exception("Inconsistent LOD indices")
+               lods += sorted([c for c in obj.children if c.lod_for_parent], key=(lambda l: l.lod_index))
+               for i, l in enumerate(lods):
+                       if i>0 and l.lod_index!=i:
+                               raise Exception("Inconsistent LOD indices")
 
                return lods
 
        def create_mesh_exporter(self):
                from .export_mesh import MeshExporter
                mesh_export = MeshExporter()
-               mesh_export.use_strips = self.use_strips
-               mesh_export.use_degen_tris = self.use_degen_tris
                return mesh_export
 
        def create_material_exporter(self):
                from .export_material import MaterialExporter
                material_export = MaterialExporter()
-               material_export.use_textures = self.use_textures
                return material_export
 
        def create_material_atlas_exporter(self):
@@ -95,9 +87,9 @@ class ObjectExporter:
 
                        progress.pop_task()
 
-       def export_object_resources(self, context, obj, resources, progress, material_atlass=None):
-               if material_atlass is None:
-                       material_atlass = {}
+       def export_object_resources(self, context, obj, resources, progress, material_atlases=None):
+               if material_atlases is None:
+                       material_atlases = {}
 
                lods = self.collect_object_lods(obj)
 
@@ -120,11 +112,11 @@ class ObjectExporter:
                                if not all(atlas_flags) or key_mismatch:
                                        raise Exception("Conflicting settings in object materials")
 
-                               if material_atlas_key in material_atlass:
-                                       material_atlas = material_atlass[material_atlas_key]
+                               if material_atlas_key in material_atlases:
+                                       material_atlas = material_atlases[material_atlas_key]
                                else:
                                        material_atlas = create_material_atlas(context, l.data.materials[0])
-                                       material_atlass[material_atlas_key] = material_atlas
+                                       material_atlases[material_atlas_key] = material_atlas
 
                                tech_name = "{}.tech".format(material_atlas.name)
                                if tech_name not in resources: