selected_only = bpy.props.BoolProperty(name="Selected objects only", description="Only export the selected objects")
active_layers = bpy.props.BoolProperty(name="Active layers only", description="Only export objects on the active layers", default=True)
resource_collection = bpy.props.BoolProperty(name="Resource collection", description="Put resources to a single collection file", default=True)
+ skip_existing = bpy.props.BoolProperty(name="Skip existing files", description="Skip resources that already exist as files", default=True)
def create_exporter(self):
from .export_scene import SceneExporter
col.prop(self, "selected_only")
col.prop(self, "active_layers")
col.prop(self, "resource_collection")
+ if self.resource_collection:
+ col.prop(self, "skip_existing")
class ExportMspGLCamera(bpy.types.Operator, ExportMspGLBase):
bl_idname = "export.mspgl_camera"
self.selected_only = False
self.active_layers = True
self.resource_collection = True
+ self.skip_existing = True
self.show_progress = True
def export_to_file(self, context, out_fn):
".tex2d": "texture2d" }
with open(os.path.join(path, base+"_resources.mdc"), "w") as res_out:
for r in refs:
+ if self.skip_existing and os.path.exists(os.path.join(path, r.name)):
+ continue
+
st = Statement(keywords[os.path.splitext(r.name)[1]], r.name)
st.sub = r.statements
st.write_to_file(res_out)