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"

how to load pak (import form fbx file)

hi guys. i load a .pak file which import form .fbx , lost textures and Materials but if i drag to viewport is work fine. so can u get me some ideas?

the setup is:

  1. import the .fbx file ( import success) alt text

  2. drag to viewport ( success)

alt text

3.make a pak file (success)

command is : UnrealPak.exe F:\01.pak D:\PAKProject\Content\testFBX\1*

4.load pak to show (not work,lost textures and other)

alt text

my load code is :

 IPlatformFile& PlatformFile = FPlatformFileManager::Get().GetPlatformFile();
     FPakPlatformFile* PakPlatformFile = new FPakPlatformFile();
     PakPlatformFile->Initialize(&PlatformFile, TEXT(""));
     const FString PakFilename = TEXT("F:\\01.pak"); 
     FPakFile PakFile(&PlatformFile,*PakFilename, false);
     const FString MountPoint(FPaths::EngineContentDir());
     if (!PakPlatformFile->Mount(*PakFilename, 0, *MountPoint))
         UE_LOG(LogClass, Warning, TEXT("Mount failed"));
     TArray<FString> FileList;
     PakFile.FindFilesAtPath(FileList, *PakFile.GetMountPoint(), true, false, true);
     FStreamableManager StreamableManager;
     // Static load object
     FString AssetName = FileList[0];
     FString AssetShortName = FPackageName::GetShortName(AssetName);
     FString LeftStr;
     FString RightStr;
     AssetShortName.Split(TEXT("."), &LeftStr, &RightStr);
     AssetName = TEXT("/Engine/") + LeftStr + TEXT(".") + LeftStr;
     FStringAssetReference Reference = AssetName;
     for (auto f : FileList)
         AssetShortName = FPackageName::GetShortName(f);
         AssetShortName.Split(TEXT("."), &LeftStr, &RightStr);
         AssetName = TEXT("/Engine/") + LeftStr + TEXT(".") + LeftStr;
         FStringAssetReference r = AssetName;
         if (false == f.Equals(FileList[0]))
             UObject* LoadObject = StreamableManager.LoadSynchronous(r, true);
     UStaticMesh *LoadObject = Cast<UStaticMesh>(StreamableManager.LoadSynchronous(Reference, true));
     if (LoadObject != nullptr)
         UE_LOG(LogClass, Warning, TEXT("LoadPakFile Object load Success..."));
         UE_LOG(LogClass, Warning, TEXT("LoadPakFile Can't load asset..."));
     if (LoadObject != nullptr)
         UE_LOG(LogTemp, Warning, TEXT("successs---------- "));
         TestActor = GetWorld()->SpawnActor<AStaticMeshActor>(
                 FRotator::ZeroRotator, FVector(-600, 360, 170), FVector(1, 1, 1)
         if (TestActor != NULL && !TestActor->IsPendingKill() && TestActor->IsValidLowLevel())
     else {
         GEngine->AddOnScreenDebugMessage(-1, 50.f, FColor::Red, TEXT("null"));

Product Version: UE 4.17
ue4fbx001.png (78.5 kB)
ue4fbx002.png (666.9 kB)
ue4fbx003.png (389.7 kB)
more ▼

asked Jun 01 '18 at 02:21 AM in Using UE4

avatar image

1 1 3

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

1 answer: sort voted first

Hi guys , I fix the error .

why cannot load success? because the error Mount Point ,the pak command must be like:


and the Mount Point is can be the PAK file fullPath , and the FStringAssetReference is the reference in UE4 (you can get it at RIGHT MOUSE KEY at UE4 Editor Content Browers)

more ▼

answered Jun 03 '18 at 04:39 PM

avatar image

1 1 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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