Class AssetImporter¶
Namespace: Apogee.Content.Import
Assembly: Apogee.Content.dll
Turns the assets of a game into the engine's own formats. It is a small registry: each res://imported/ beside an index.xml that says which source each came from (.import.xml settings, the asset, and every file the import read for it (a model's
buffers and textures, the modules a shader imports). Artifacts whose source is gone are deleted. Importers run in the order of the list, and a file that an earlier import read (a model's
image) is not imported on its own. res:// has to be writable.
Importing also gives assets their UID (.import.xml (made if there is none), an authored one (imported/assets.xml lists them all for
public sealed class AssetImporter
Inheritance¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors¶
AssetImporter(VirtualFileSystem, IReadOnlyList<IAssetImporter>?)¶
Turns the assets of a game into the engine's own formats. It is a small registry: each res://imported/ beside an index.xml that says which source each came from (.import.xml settings, the asset, and every file the import read for it (a model's
buffers and textures, the modules a shader imports). Artifacts whose source is gone are deleted. Importers run in the order of the list, and a file that an earlier import read (a model's
image) is not imported on its own. res:// has to be writable.
Importing also gives assets their UID (.import.xml (made if there is none), an authored one (imported/assets.xml lists them all for
public AssetImporter(VirtualFileSystem files, IReadOnlyList<IAssetImporter>? importers = null)
Parameters¶
files VirtualFileSystem
importers IReadOnlyList<IAssetImporter>?
Fields¶
CacheFolder¶
public const string CacheFolder = "imported"
Field Value¶
ImporterVersion¶
Bumped when the key or the index changes, so that old artifacts are made again.
public const int ImporterVersion = 3
Field Value¶
Properties¶
Defaults¶
The importers of the content library: models, then images.
public static IReadOnlyList<IAssetImporter> Defaults { get; }
Property Value¶
Methods¶
LoadIndex(VirtualFileSystem)¶
What the index in files says has been imported (empty when there is none).
public static IReadOnlyList<ImportEntry> LoadIndex(VirtualFileSystem files)
Parameters¶
files VirtualFileSystem
Returns¶
Reimport(string)¶
Imports one asset again whether or not it changed, and leaves the rest of the index as it is. A file no importer takes is reported as failed.
public ImportReport Reimport(string source)
Parameters¶
source string
Returns¶
Run(bool)¶
Imports what needs it. force imports everything again.
public ImportReport Run(bool force = false)
Parameters¶
force bool
Returns¶
StatusOf(string)¶
Where the asset source (relative to res://: models/car.glb) stands, from the index and the file as it is now. It reads the files, so it is for a person looking at one, not for every file every frame.
public AssetStatus StatusOf(string source)
Parameters¶
source string