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;
NameMap
.usmap name map
public List<string> NameMap;
EnumMap
.usmap enum map
public Dictionary<string, UsmapEnum> EnumMap;
Schemas
.usmap schema map
public Dictionary<string, UsmapSchema> Schemas;
CityHash64Map
Pre-computed CityHash64 map for all relevant strings
public Dictionary<ulong, string> CityHash64Map;
USMAP_MAGIC
Magic number for the .usmap format
public static ushort USMAP_MAGIC;
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 BinaryReader 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 BinaryReader 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)
public static UsmapSchema GetSchemaFromStructExport(StructExport exp)
Parameters
exp
StructExport
Returns
GetAllProperties(String, UnrealPackage)
Retrieve all the properties that a particular schema can reference.
public IList<UsmapProperty> GetAllProperties(string schemaName, UnrealPackage asset)
Parameters
schemaName
String
The name 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, Boolean)
public UsmapSchema GetSchemaFromName(string nm, UnrealPackage asset, bool throwExceptions)
Parameters
nm
String
asset
UnrealPackage
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 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