πŸ“¦Importing models in a packaged project

Quick overview at how to import Anything world models in a packaged project

Requirements:

  • Unreal Engine 5.0, 5.1, 5.2 or 5.3

  • Unreal C++ Project

  • Visual Studio 2019 (for 5.0 to 5.2)

  • Visual Studio 2022 (for 5.3)

  • Anything World Account Details

  • Anything World SDK

  • Windows

Setting Up your project

To use pak files in your project, you need to enable/disable a few options to set everything up properly. A part of pak file, Unreal provides other ways to load cooked content into your project a part of paks, but those ways aren’t compatible with others.

Firstly, you need to enable the option to use paks and disable the other container options (Io store and Zen Store). This option will enable the processing of the paks in your packaged project. The other important option is Generate Chunks. This option will enable the pool to load multiple paks based on the chunk id.

It's important to disable these two options to load Anything World Paks in your project. The first option will specify that all the paks will contain C++ cooked assets inside. If you enable this option, the project will skip all the C++ assets and only load blueprint ones. The second one is the Editor only option. Disabling this one will enable all the primary asset labels to be used in a packaged project.

To load materials from paks you need to change the Default Skin Cache Behavior from Inclusive to Exclusive. This option will enable the usage of external materials. A part of that you need higher Maximum memory for Compute Skin Cache per world into 1500.

You need to enable Support 16-bit Bone Index and Use Unlimited Bone influences to load all the animated models in your project.

All the textures that are cooked outside the main project are treated as virtual textures. To load all the textures from pak files, you need to enable this option.If you use pak chunk strategy in your project, we highly recommend not surpassing 99 in your chunk IDs. Anything world model chunk ids goes from 100 and further.

Anything World Pak utilities

Anything world plugin comes with a couple of C++ functions that the user can call on his project to request models from the API in his packaged project. All those methods are inside a UObject named PakLoader that provides the minimum functionalities to load pak files.

class UPakLoader

    Exposed Blueprint functions:
    
    * Sets the API key of the user to download models
    * @param InApiKey - API key of the user
    void SetApiKey(const FString& InApiKey);
    
    * Downloads an specific model Entry
    * @param Name - Model name
    void DownloadModelEntry(const FString& Name);
    
    * Loads an specific model Entry from Paks folder
    * @param Name - Model name
    void LoadModelEntry(const FString& Name);
    

To use these functionalities, you only need to instantiate one PakLoader, Set your API key using SetApiKey() method and download the model using the DownloadModelEntry() method.

Pak Tester

Inside the plugin, you will find a user widget named PakTester. This widget provides a simple interface to download models using PakLoader.

To use it, you need to modify it by adding your API Key inside. At the begging of the execution, the widget will create a new PakLoader and set your API Key. The UI adds two buttons, one to download models from the API and the other to load paks from the paks folder.

Warning: Remember to add one Nav Mesh Bounds Volume inside your map, or the models will not be able to navigate around.

Last updated