x

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"

load old version pak file fail

I use 4.19 to load pak file packed by 4.13,Is there something wrong? The error is:

LogPakFile: Error: Attempted seek using thread-specific pak file reader on the wrong thread. Reader for thread 12481 used by thread 10592. LogPakFile: Error: Attempted serialize using thread-specific pak file reader on the wrong thread. Reader for thread 12481 used by thread 10592.

 m_PPakPlatform = new FPakPlatformFile;
 m_PInnerPlatform = &FPlatformFileManager::Get().GetPlatformFile();
 m_PPakPlatform->Initialize(m_PInnerPlatform, TEXT(""));
 m_PPakPlatform->InitializeNewAsyncIO();
 FPlatformFileManager::Get().SetPlatformFile(*m_PPakPlatform);

 FString pakFilePath = FPaths::GameContentDir() + TEXT("Models/uncooked/4f921108d13911e4879a00163e021ee1.pak");
             FPakFile PakFile(m_PPakPlatform, *pakFilePath, false);
             if (!PakFile.IsValid()) {
                 GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red,
                     "Invalid pak file: " + pakFilePath);
                 return;
             }
     
             FString MountingPath = FPaths::GameContentDir() + TEXT("4f921108d13911e4879a00163e021ee1") + "/";
             FPaths::MakeStandardFilename(MountingPath);
             PakFile.SetMountPoint(*MountingPath);
             if (!m_PPakPlatform->Mount(*pakFilePath, 0,
                 *MountingPath)) {
                 GEngine->AddOnScreenDebugMessage(
                     -1, 5.f, FColor::Red, "Failed to mount pak file: " + pakFilePath);
                 return;
             }
     
             TSet<FString> fileList;
             PakFile.FindFilesAtPath(fileList, *PakFile.GetMountPoint(), true, false,
                 true);
     
             UE_LOG(LogTemp, Warning, TEXT("------------------"));
             for (FString File : fileList.Array())
             {            
                 FString AssetPath;
                 if (File.EndsWith(FPackageName::GetAssetPackageExtension()) ||
                     File.EndsWith(FPackageName::GetMapPackageExtension())) {
                     FString assetShortName = FPackageName::GetShortName(File);
                     assetShortName.RemoveFromEnd(FPackageName::GetAssetPackageExtension());
     
                     AssetPath = FString(TEXT("/Game/")) + TEXT("4f921108d13911e4879a00163e021ee1") + TEXT("/") + assetShortName + TEXT(".") +
                         assetShortName;
                 }
                 UObject* Object = LoadObject<UObject>(nullptr, *AssetPath);
                 if (Object)
                 {
                     UE_LOG(LogTemp, Warning, TEXT("Object:%s"), *Object->GetName());
                 }
             }



Product Version: UE 4.19
Tags:
more ▼

asked Sep 29 '18 at 06:42 AM in C++ Programming

avatar image

困兽
1 4

(comments are locked)
10|2000 characters needed characters left

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