Usmap
Namespace: UAssetAPI.Unversioned
public class Usmap
Fields
FilePath
The path of the file on disk. This does not need to be specified for regular parsing.
public string FilePath;
FileVersionUE4
Game UE4 object version
public ObjectVersion FileVersionUE4;
FileVersionUE5
Game UE5 object version
public ObjectVersionUE5 FileVersionUE5;
CustomVersionContainer
All the custom versions stored in the archive.
public List<CustomVersion> CustomVersionContainer;
NetCL
public uint NetCL;
SkipBlueprintSchemas
Whether or not to skip blueprint schemas serialized in this mappings file. Only useful for testing.
public bool SkipBlueprintSchemas;
NameMap
.usmap name map
public List<string> NameMap;
EnumMap
.usmap enum map
public IDictionary<string, UsmapEnum> EnumMap;
Schemas
.usmap schema map
public IDictionary<string, UsmapSchema> Schemas;
CityHash64Map
Pre-computed CityHash64 map for all relevant strings
public IDictionary<ulong, string> CityHash64Map;
FailedExtensions
List of extensions that failed to parse.
public List<string> FailedExtensions;
PathsAlreadyProcessedForSchemas
public ISet<string> PathsAlreadyProcessedForSchemas;
USMAP_MAGIC
Magic number for the .usmap format
public static ushort USMAP_MAGIC;
Properties
AreFNamesCaseInsensitive
Whether or not FNames are case insensitive. Modifying this property is an expensive operation, and will re-construct several dictionaries.
public bool AreFNamesCaseInsensitive { get; set; }
Property Value
Constructors
Usmap(String)
Reads a .usmap file from disk and initializes a new instance of the Usmap class to store its data in memory.
public Usmap(string path)
Parameters
path
String
The path of the file file on disk that this instance will read from.
Exceptions
FormatException
Throw when the file cannot be parsed correctly.
Usmap(UsmapBinaryReader)
Reads a .usmap file from a UsmapBinaryReader and initializes a new instance of the Usmap class to store its data in memory.
public Usmap(UsmapBinaryReader reader)
Parameters
reader
UsmapBinaryReader
The file's UsmapBinaryReader that this instance will read from.
Exceptions
FormatException
Throw when the asset cannot be parsed correctly.
Usmap()
Initializes a new instance of the Usmap class. This instance will store no data and does not represent any file in particular until the Usmap.ReadHeader(UsmapBinaryReader) method is manually called.
public Usmap()
Methods
GetSchemaFromStructExport(String, UnrealPackage)
public static UsmapSchema GetSchemaFromStructExport(string exportName, UnrealPackage asset)
Parameters
exportName
String
asset
UnrealPackage
Returns
GetSchemaFromStructExport(StructExport, Boolean)
public static UsmapSchema GetSchemaFromStructExport(StructExport exp, bool isCaseInsensitive)
Parameters
exp
StructExport
isCaseInsensitive
Boolean
Returns
GetAllProperties(String, String, UnrealPackage)
Retrieve all the properties that a particular schema can reference.
public IList<UsmapProperty> GetAllProperties(string schemaName, string modulePath, UnrealPackage asset)
Parameters
schemaName
String
The name of the schema of interest.
modulePath
String
Module path of the schema of interest.
asset
UnrealPackage
An asset to also search for schemas within.
Returns
IList<UsmapProperty>
All the properties that the schema can reference.
GetAllPropertiesAnnotated(String, UnrealPackage, IDictionary<String, String>, Boolean, String, String)
Retrieve all the properties that a particular schema can reference as an annotated, human-readable text file.
public string GetAllPropertiesAnnotated(string schemaName, UnrealPackage asset, IDictionary<string, string> customAnnotations, bool recursive, string headerPrefix, string headerSuffix)
Parameters
schemaName
String
The name of the schema of interest.
asset
UnrealPackage
An asset to also search for schemas within.
customAnnotations
IDictionary<String, String>
A map of strings to give custom annotations.
recursive
Boolean
Whether or not to dump data for parent schemas as well.
headerPrefix
String
The prefix of the subheader for each relevant schema.
headerSuffix
String
The suffix of the subheader for each relevant schema.
Returns
String
An annotated, human-readable text file containing the properties that the schema can reference.
GetSchemaFromName(String, UnrealPackage, String, Boolean)
public UsmapSchema GetSchemaFromName(string nm, UnrealPackage asset, string modulePath, bool throwExceptions)
Parameters
nm
String
asset
UnrealPackage
modulePath
String
throwExceptions
Boolean
Returns
TryGetProperty<T>(FName, AncestryInfo, Int32, UnrealPackage, T&, Int32&)
Attempts to retrieve the corresponding .usmap property, given its ancestry.
public bool TryGetProperty<T>(FName propertyName, AncestryInfo ancestry, int dupIndex, UnrealPackage asset, T& propDat, Int32& idx)
Type Parameters
T
The type of property to output.
Parameters
propertyName
FName
The name of the property to search for.
ancestry
AncestryInfo
The ancestry of the property to search for.
dupIndex
Int32
The duplication index of the property to search for. If unknown, set to 0.
asset
UnrealPackage
An asset to also search for schemas within.
propDat
T&
The property.
idx
Int32&
The index of the property.
Returns
Boolean
Whether or not the property was successfully found.
TryGetPropertyData<T>(FName, AncestryInfo, UnrealPackage, T&)
Attempts to retrieve the corresponding .usmap property data corresponding to a specific property, given its ancestry.
public bool TryGetPropertyData<T>(FName propertyName, AncestryInfo ancestry, UnrealPackage asset, T& propDat)
Type Parameters
T
The type of property data to output.
Parameters
propertyName
FName
The name of the property to search for.
ancestry
AncestryInfo
The ancestry of the property to search for.
asset
UnrealPackage
An asset to also search for schemas within.
propDat
T&
The property data.
Returns
Boolean
Whether or not the property data was successfully found.
PathToStream(String)
Creates a MemoryStream from an asset path.
public static MemoryStream PathToStream(string p)
Parameters
p
String
The path to the input file.
Returns
MemoryStream
A new MemoryStream that stores the binary data of the input file.
PathToReader(String)
Creates a BinaryReader from an asset path.
public UsmapBinaryReader PathToReader(string p)
Parameters
p
String
The path to the input file.
Returns
UsmapBinaryReader
A new BinaryReader that stores the binary data of the input file.
ReadHeader(UsmapBinaryReader)
public UsmapBinaryReader ReadHeader(UsmapBinaryReader reader)
Parameters
reader
UsmapBinaryReader
Returns
Read(UsmapBinaryReader)
public void Read(UsmapBinaryReader compressedReader)
Parameters
compressedReader
UsmapBinaryReader