Struct uasset::AssetHeader
source · pub struct AssetHeader<R> {Show 33 fields
pub archive: Archive<R>,
pub total_header_size: i32,
pub folder_name: String,
pub package_flags: u32,
pub names: Vec<String>,
pub soft_object_paths_count: i32,
pub soft_object_paths_offset: i32,
pub localization_id: Option<String>,
pub gatherable_text_data_count: i32,
pub gatherable_text_data_offset: i32,
pub export_count: i32,
pub export_offset: i32,
pub imports: Vec<ObjectImport>,
pub depends_offset: i32,
pub soft_package_references_count: i32,
pub soft_package_references_offset: i32,
pub searchable_names_offset: Option<i32>,
pub thumbnail_table_offset: i32,
pub engine_version: UnrealEngineVersion,
pub compatible_with_engine_version: UnrealEngineVersion,
pub compression_flags: u32,
pub package_source: u32,
pub additional_packages_to_cook: Vec<String>,
pub texture_allocations: Option<i32>,
pub asset_registry_data_offset: i32,
pub bulk_data_start_offset: i64,
pub world_tile_info_data_offset: Option<i32>,
pub chunk_ids: Vec<i32>,
pub preload_dependency_count: i32,
pub preload_dependency_offset: i32,
pub names_referenced_from_export_data_count: i32,
pub payload_toc_offset: i64,
pub data_resource_offset: Option<i32>,
}
Expand description
A table of contents for a uasset loaded from disk, containing all the shared package summary information.
This roughly maps to FPackageFileSummary
in Engine/Source/Runtime/CoreUObject/Public/UObject/PackageFileSummary.h, except we
load some of the indirectly referenced data (i.e. names, imports, exports).
Fields§
§archive: Archive<R>
§total_header_size: i32
Full size of the asset header (C++ name: TotalHeaderSize
)
folder_name: String
The “Generic Browser” folder name that it lives in (C++ name: FolderName
)
package_flags: u32
Package flags like whether this was serialized for the editor (C++ name: PackagesFlags
)
names: Vec<String>
Table of names used by this asset (C++ name: NameCount
and NameOffset
)
soft_object_paths_count: i32
Number of soft object paths references contained in this package (C++ name: SoftObjectPathsCount
)
soft_object_paths_offset: i32
Location into the file on disk for the soft object paths reference list (C++ name: SoftObjectPathsOffset
)
localization_id: Option<String>
Localization ID for this package (C++ name: LocalizationId
)
gatherable_text_data_count: i32
Number of gatherable text data entries (C++ name: GatherableTextDataCount
)
gatherable_text_data_offset: i32
Location on disk of gatherable text data entries (C++ name: GatherableTextDataOffset
)
export_count: i32
Number of ExportMap entries (C++ name: ExportCount
)
export_offset: i32
Location on disk of the ExportMap data (C++ name: ExportOffset
)
imports: Vec<ObjectImport>
Imports (dependencies) listed by this asset (C++ name: ImportCount
and ImportOffset
)
depends_offset: i32
Location of DependsMap data (C++ name: DependsOffset
)
soft_package_references_count: i32
Number of soft package references that are listed (C++ name: SoftPackageReferencesCount
)
soft_package_references_offset: i32
Location on disk of the soft package references (C++ name: SoftPackageReferencesOffset
)
searchable_names_offset: Option<i32>
Location of SearchableNamesMap data (C++ name: SearchableNamesOffset
)
thumbnail_table_offset: i32
Offset of the thumbnail table (C++ name: ThumbnailTableOffset
)
engine_version: UnrealEngineVersion
Information about the engine version the asset was saved with (C++ name: SavedByEngineVersion
)
compatible_with_engine_version: UnrealEngineVersion
Information about the engine version the asset is compatible with (for hotfix support) (C++ name: CompatibleWithEngineVersion
)
compression_flags: u32
Flags dictating compression settings for this asset (C++ name: CompressionFlags
)
package_source: u32
This is a random number in assets created by the shipping build of the editor, and a crc32 of the uppercased filename
otherwise. Weird. Used to determine if an asset was made “by a modder or by Epic (or licensee)”. (C++ name: PackageSource
)
additional_packages_to_cook: Vec<String>
No longer used
texture_allocations: Option<i32>
No longer used
asset_registry_data_offset: i32
Location on disk of the asset registry tag data (C++ name: AssetRegistryDataOffset
)
bulk_data_start_offset: i64
Offset to the location in the file where the bulkdata starts (C++ name: BulkDataStartOffset
)
world_tile_info_data_offset: Option<i32>
Offset to the location in the file where the FWorldTileInfo data starts (C++ name: WorldTileInfoDataOffset
)
chunk_ids: Vec<i32>
Streaming install ChunkIDs (C++ name: ChunkIDs
)
preload_dependency_count: i32
Number of preload dependency data entries (C++ name: PreloadDependencyCount
)
preload_dependency_offset: i32
Location into the file on disk for the preload dependency data (C++ name: PreloadDependencyOffset
)
names_referenced_from_export_data_count: i32
Number of names that are referenced from serialized export data (sorted first in the name map) (C++ name: NamesReferencedFromExportDataCount`)
payload_toc_offset: i64
Location into the file on disk for the payload table of contents data (C++ name: PayloadTocOffset
)
data_resource_offset: Option<i32>
Location into the file of the data resource(s) (C++ name: DataResourceOffset
)
Implementations§
source§impl<R> AssetHeader<R>where
R: Seek + Read,
impl<R> AssetHeader<R>where R: Seek + Read,
sourcepub fn new(reader: R) -> Result<Self>
pub fn new(reader: R) -> Result<Self>
Parse an AssetHeader
from the given reader, assuming a little endian uasset
source§impl<R> AssetHeader<R>
impl<R> AssetHeader<R>
sourcepub fn find_name(&self, find_name: &str) -> Option<NameReference>
pub fn find_name(&self, find_name: &str) -> Option<NameReference>
Attempt to look up find_name
in the name table serialized in AssetHeader::names
, will return None
if the name does not exist. Names are case insensitive.
sourcepub fn resolve_name<'a>(
&'a self,
name_reference: &NameReference
) -> Result<Cow<'a, str>, InvalidNameIndexError>
pub fn resolve_name<'a>( &'a self, name_reference: &NameReference ) -> Result<Cow<'a, str>, InvalidNameIndexError>
Look up the string representation for a given NameReference
.
sourcepub fn package_import_iter(&self) -> ImportIterator<'_, R> ⓘ
pub fn package_import_iter(&self) -> ImportIterator<'_, R> ⓘ
Create an iterator over the names of just the packages imported by this asset (i.e. its dependencies).
source§impl<R> AssetHeader<R>where
R: Seek + Read,
impl<R> AssetHeader<R>where R: Seek + Read,
sourcepub fn thumbnail_iter(
&mut self
) -> Result<UnrealArrayIterator<'_, UnrealThumbnailInfo, R>>
pub fn thumbnail_iter( &mut self ) -> Result<UnrealArrayIterator<'_, UnrealThumbnailInfo, R>>
Create an iterator over the names of just the packages imported by this asset (i.e. its dependencies).