Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Loading UMaps and FBX assets from Pak File

Is this still a known issue? I can load a simple material with no materials but I can't load fbx's or umaps as these have internal dependencies on other assets. When you mount the pak file the target asset becomes available but the dependencies are not available for example /Engine/assetdepends. When you unmount the pak file the dependencies become available but the target asset cannot be found. So how are supposed to load these assets?


     FPakPlatformFile* UAssetTools::LoadPak(FString PakFileName) {

 IPlatformFile& InnerPlatformFile = FPlatformFileManager::Get().GetPlatformFile();

 FPakPlatformFile* PakPlatformFile = new FPakPlatformFile();

 bool ret = PakPlatformFile->Initialize(&InnerPlatformFile, TEXT(""));
 if (!ret) {
     return nullptr;

 PakPlatformFile->InitializeNewAsyncIO(); //https://answers.unrealengine.com/questions/574388/how-to-mount-a-pak-file-at-game-content-directory.html

 const FString PakFilePath = PakFileName;

 UE_LOG(LogTemp, Warning, TEXT("%s"), *PakFilePath);
 FString MountPoint = FPaths::EngineContentDir() +TEXT("DLC/");

 FPakFile PakFile(PakPlatformFile, *PakFilePath, false);
 if (PakFile.IsValid()) { 
     UE_LOG(LogTemp, Warning, TEXT("Valid pak file found"));
 else {
     UE_LOG(LogTemp, Warning, TEXT("Invalid pak file found"));

 if (!PakPlatformFile->Mount(*PakFilePath, 0, *MountPoint))
     return nullptr;
 else {

     //FStreamableManager Streamable;
     // list of references
     TArray<FString> AssetsToLoad;

     TArray<FString> FileList;
     PakFile.FindFilesAtPath(FileList, *PakFile.GetMountPoint(), true, false, true);

     for (int i = 0; i < FileList.Num(); i++) {
         FString AssetName = FileList[i];
         FString AssetShortName = FPackageName::GetShortName(AssetName);
         FString LeftStr;
         FString RightStr;
         AssetShortName.Split(TEXT("."), &LeftStr, &RightStr);

         // check format is uasset
         //if (RightStr==TEXT("uasset")|| RightStr.Contains(TEXT("umap"))) {
         if (true) {
             AssetName = TEXT("/Engine/DLC/") + LeftStr + TEXT(".") + LeftStr;
         else {
             // todo error
     Dump visitor;
     PakPlatformFile->IterateDirectoryRecursively(*MountPoint, visitor);

     UE_LOG(LogTemp, Warning, TEXT("Register mount point here"));
     FPackageName::RegisterMountPoint("/Engine/DLC/", *MountPoint);//StandardFilename);

     FPakInfo info = PakFile.GetInfo();

     // load assets in pak
     for (int i = 0; i < AssetsToLoad.Num(); i++) {
         TAssetPtr<UObject> asset = TAssetPtr<UObject>(FStringAssetReference(AssetsToLoad[i]));

     // unmount pak
     // or restore the old platform file
     return NULL;


Product Version: UE 4.17
more ▼

asked Apr 07 '18 at 04:38 PM in C++ Programming

avatar image

0 2 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question