From: Mikko Rasa Date: Wed, 15 May 2019 21:38:02 +0000 (+0300) Subject: Combine shared_mesh and shared_tech into a single option X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=04c89988c7eda12ea763a9283df0aeba177a11ad;p=libs%2Fgl.git Combine shared_mesh and shared_tech into a single option --- diff --git a/blender/io_mspgl/__init__.py b/blender/io_mspgl/__init__.py index e1efbc21..724d625b 100644 --- a/blender/io_mspgl/__init__.py +++ b/blender/io_mspgl/__init__.py @@ -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" diff --git a/blender/io_mspgl/export_object.py b/blender/io_mspgl/export_object.py index df5d619a..5a707bad 100644 --- a/blender/io_mspgl/export_object.py +++ b/blender/io_mspgl/export_object.py @@ -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)