IOConfig.FileSystemFactory

IOConfig.FileSystemFactory property

Gets or sets the factory class for FileSystem. The default factory will create LocalFileSystem which is not suitable for server environment.

public static FileSystemFactory FileSystemFactory { get; set; }

Examples

The default FileSystem in SaveOptions/LoadOptions is directory-based file system, You can override the default implementation by specify it through IOConfig.FileSystemFactory:

IOConfig.FileSystemFactory = () => {
    return FileSystem.CreateDummyFileSystem();
};

Scene scene = new Scene();
var material = new PhongMaterial();
var boxNode = scene.RootNode.CreateChildNode(new Box());
boxNode.Material = material;

//opt.FileSystem would be dummy file system now
var opt = new ObjSaveOptions();
using var output = new MemoryStream();
opt.FileName = "output.obj";
scene.Save(output, opt);
//the material file output.mtl will not be written to any places because we've configured a dummy file system as default implementation.

See Also