Additional Asset Directories not Copied to Packaged Build
I am not able to get the Additional Asset Directories to Cook feature working in my project. Here is how I am validating this result.
Add an asset directory that I want to cook.
This asset directory contains textures that I reference in C++:
They are initialized in my constructor via a static like so (all works fine in PIE):
After packaging the build, I expect this folder to exist in the final package folder, it does not.
Am I misinterpreting the asset directory parameter? How do I get these additional assets into my packaged build?
Things I've tried:
Here is the log output from packaging in editor None of these attempts resulted in any change in output. Please tell me what I'm doing wrong here, I'm sure it's something fundamental or alternatively something is fundamentally broken.
Well, I finally found the issue. It wasn't a bug, just an unexpected feature of the staging system.
The final argument passed to the function is a bool called
So basically if you aren't using a pakfile, bStripFilesForOtherPlatforms will be true and you're in danger of getting the same behavior I describe.
When this boolean is set, there's some code in
So for instance trying to include content named /Game/Content/UI/XboxOne/button.uasset when building for Win32 will get ignored because XboxOne is a platform name. If the folder name was XboxOne1 or MyXboxOne it would have been ok since the match string is "/Platform/".
I looked through the docs and couldn't find any mention of platform specific folder names as part of the packaging process! Kind of a huge deal here I think.
For future generations, strategically use platform names in your build folders: Win32 Win64 WinRT WinRT_ARM UWP Mac XboxOne PS4 IOS Android HTML5 Linux AllDesktop
In short, renaming my folder from XboxOne to Xbone fixed the problem.
answered Sep 11 '15 at 05:45 PM
edit: Top editing because I found something useful.
Someone came across this. Looks like unreal doesn't like to package directories with "xbox" or "ps4" in their names. Maybe try changing the directory name and see if it packages?
I believe all the asset directories that get cooked get compiled into an intermediate file format that lives under Your_Cooked_Project_Path\Content\Paks as .pak files and the directory structure is not preserved. If you want the directory structure and all files copied across it should go under "Additional Non-Asset Directories to Copy" or Cook depending on what you want.
The reason it probably doesn't work in the cooked build is probably because your paths in your constructor aren't asset references, which should look like this: "Texture2D'/Game/Textures/Light01.Light01'"
I think this is more that you took a really roundabout way of loading your assets that happened to work in the editor by some random quirk of the FObjectFinder. You can copy and paste the actual asset paths by right clicking the asset in the content browser and "Copy Reference" then paste that in for your strings. Try that and see what happens.
edit: Hrm. I think the first bit I said is because we have "Create compressed cooked packages" ticked. hrmrmrm. I'll poke around more, but we've had no issues using "Additional Asset Directories to Cook".
Follow this question
Once you sign in you will be able to subscribe for any updates here