Class ImportSettings¶
Namespace: Apogee.Content.Import
Assembly: Apogee.Content.dll
What an <asset>.import.xml file next to an asset says about importing it.
public sealed record ImportSettings : IEquatable<ImportSettings>
Inheritance¶
Implements¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Properties¶
Compression¶
Textures: how they are stored, GPU-compressed (the default) or as RGBA8.
public TextureCompression Compression { get; init; }
Property Value¶
Mips¶
Textures: build the mip chain.
public bool Mips { get; init; }
Property Value¶
NormalMap¶
Textures: the image is a normal map. It is linear whatever
public bool NormalMap { get; init; }
Property Value¶
Optimize¶
Models: optimize the meshes.
public bool Optimize { get; init; }
Property Value¶
Srgb¶
Textures: the colors are sRGB.
public bool Srgb { get; init; }
Property Value¶
Uid¶
The UID of the asset (the uid attribute), or
public AssetUid Uid { get; init; }
Property Value¶
Variants¶
Shaders: the variants to compile besides the default one, which has no defines.
public IReadOnlyList<ShaderVariant> Variants { get; init; }
Property Value¶
Methods¶
KeyText(string)¶
The text of a sidecar as the import key sees it: the same text without the root's uid attribute, so that minting a UID into a sidecar (or into a new one) does not change the key and
make the asset import again, and every key made before UIDs existed is still the one a sidecar without a UID makes.
- The empty text stays empty.
- A sidecar that says nothing but a UID (
<Import uid="…"/>, which is what minting makes when there was no sidecar) is the same as no sidecar: empty. (A sidecar that already existed with no settings at all,<Import/>, keeps its own key, so adding a UID to it imports the asset once more: it says nothing, and nobody writes it.) - Otherwise the
uidattribute and the white space before it are taken out textually (only that attribute changes), and everything else is returned byte for byte: it is the text people wrote, and it was part of the key before UIDs existed.
Text that is not valid XML is returned as it is (reading it as settings fails on its own).
public static string KeyText(string sidecarText)
Parameters¶
sidecarText string
Returns¶
Parse(string, string)¶
Reads settings from the text of a sidecar file; origin names it in errors.
public static ImportSettings Parse(string text, string origin)
Parameters¶
text string
origin string
Returns¶
Exceptions¶
The file is not valid.