Is it possible to use temporary assets 'streamed'?

Hello,

I would like to know if there is a way to load pak, mount it and use uasset in it WITHOUT having the .uassets loaded in the project. My company is making ‘avatars’, 3D character (fbx + texture), and we want to give an example project for developers to allow them to use these characters but without having direct access to the fbx.

For example, I test in local, I have a .pak there: C:\Users\Username\Desktop\Test.pak made with UnrealPak.exe

This pak contain:

  • texture.uasset
  • skeletalMesh.uasset
  • physicsAsset.uasset
  • skeleton.uasset
  • material.uasset
  1. I get the pak and mount it here: /Game/DLC/packageName
  2. /!\ Problem – If I ‘SyncLoad’ / ‘StaticLoadObject’ these assets, they will be available in the mount directory /Game/DLC/packageName

I want to know if there is something like this in Unity: Unity - Scripting API: AssetBundle

I work on UE4 4.21.

Hope someone could help me. Thanks. :slight_smile:

~Nyudeb

After a lot of research, I didn’t found anything…
I actually want to be able to import fbx + texture or pre packaged .uasset (like unity3d bundle) to UE4 project at runtime. (downloaded from server or from local path).

Is that possible? Does anyone have any idea what to do?

I’m starting to lose hope but I think it must exist because it’s possible on Unity…

yes, it is possible to do, there are lots of threads in the answerhub about it, search specifically for Pak mounting. Here is a thread with a lot of info about it and people sharing their experciences. I’ve worked on this personally and got it working but sadly I cannot share the code due to NDA, but basically what you want to do is:

  1. Download pak into PersistentDownloadDir
  2. Mount the pak on the root of the assets inside the pak (/Game/Paks for instance).
  3. Use the asset registry to actually find the files.
  4. Load them.
  5. Unload and unmount the pak after the needed assets are used or the system will block access to other assets.

Here is a thread where i posted a huge chunck of the function I made, and where I explained what I changed to make it work. Hope it helps.

Oh, thanks. I will try this way. :slight_smile:

So, I tried and I’m not able to get assets from the mountpoint with the AssetRegistry. I have a folder “/Game/UNPAK/” where I mount my .pak. I added a test material file in it and it’s the only one file found with AssetRegistry… (working in editor)

The mount pak needs to be the root of your original assets. For instance if you have a pak with one asset like this /Game/Materials/ExampleMaterial.uasset, your mount point must be /Game/Materials or else the asset registry will not find it. Be sure you are respecting the original structure of the pak.

Ok, I had to do:

if (PlatformFile->Mount(*PakPath, 0, *InMountPoint))

Instead of :

if(FCoreDelegates::OnMountPak.Execute(PakPath, 4, &Visitor))

Now it work. :smiley:

Thanks for your help :slight_smile: