]> git.tdb.fi Git - libs/gl.git/commitdiff
Combine shared_mesh and shared_tech into a single option
authorMikko Rasa <tdb@tdb.fi>
Wed, 15 May 2019 21:38:02 +0000 (00:38 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 15 May 2019 21:38:02 +0000 (00:38 +0300)
blender/io_mspgl/__init__.py
blender/io_mspgl/export_object.py

index e1efbc21d0feeaafc2e5a04e6263e29391169122..724d625be566ee853f7a3f44836c32f34a885e10 100644 (file)
@@ -64,9 +64,8 @@ class ExportMspGLObject(bpy.types.Operator, ExportMspGLMeshBase):
                        ("INLINE", "Inline", "Embed textures in the object")))
 
        separate_mesh = bpy.props.BoolProperty(name="Separate mesh", description="Write mesh data into a separate file", default=False)
-       shared_mesh = bpy.props.BoolProperty(name="Shared mesh", description="Use mesh name for mesh file to enable sharing", default=True)
        separate_tech = bpy.props.BoolProperty(name="Separate technique", description="Write technique data into a separate file", default=False)
-       shared_tech = bpy.props.BoolProperty(name="Shared technique", description="Use material name for technique file to enable sharing", default=True)
+       shared_resources = bpy.props.BoolProperty(name="Shared resources", description="Use global names for resource files to enable sharing", default=True)
 
        export_lods = bpy.props.BoolProperty(name="Export LoDs", description="Export all levels of detail", default=True)
 
@@ -87,11 +86,9 @@ class ExportMspGLObject(bpy.types.Operator, ExportMspGLMeshBase):
                col = self.layout.column()
                col.label("Files")
                col.prop(self, "separate_mesh")
-               if self.separate_mesh:
-                       col.prop(self, "shared_mesh")
                col.prop(self, "separate_tech")
-               if self.separate_tech:
-                       col.prop(self, "shared_tech")
+               if self.separate_mesh or self.separate_tech:
+                       col.prop(self, "shared_resources")
 
 class ExportMspGLArmature(bpy.types.Operator, ExportMspGLBase):
        bl_idname = "export.mspgl_armature"
index df5d619a9fd1e2548c3520b1820382c6d59d8be1..5a707bad216e0250360fa34e13589af558997030 100644 (file)
@@ -32,9 +32,8 @@ class ObjectExporter:
        def __init__(self):
                self.textures = "REF"
                self.separate_mesh = False
-               self.shared_mesh = True
                self.separate_tech = False
-               self.shared_tech = True
+               self.shared_resources = True
                self.export_lods = True
 
        def export(self, context, out_file, obj=None, progress=None):
@@ -101,7 +100,7 @@ class ObjectExporter:
                if self.separate_mesh:
                        from .outfile import open_output
                        path, name = external_name(out_file, ".mesh", lod_index)
-                       if self.shared_mesh:
+                       if self.shared_resources:
                                name = obj.data.name+".mesh"
                        mesh_out = open_output(os.path.join(path, name))
                        mesh = mesh_export.export(context, mesh_out, obj, progress)
@@ -142,7 +141,7 @@ class ObjectExporter:
                        else:
                                out_file.write("technique", '"{}"'.format(obj.technique))
                elif self.separate_tech:
-                       if self.shared_tech and material:
+                       if self.shared_resources and material:
                                name = material.name+".tech"
                        tech_out = open_output(os.path.join(path, name))
                        self.export_technique_definition(material, tech_out)