Issue Packaging ONLY used assets

Hi

While packaging my project i noticed it was packing up all the assets in the project even the ones i’m not using. How do i keep it from packing the meshes and textures im not using?
The project does contain maps displaying the assets from each pack downloaded from the market place, but i’m not using them in my project as well. Should i delete the maps that i’m not using? Will it keep from packing all the unused assets?
Thanks.

1 Like

Having another problem. now it says the packaging failed and i have no idea why.

This is what i get at the end:

MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.01.31-15.40.12:753] 0]LogInit:Display:
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.01.31-15.40.12:753] 0]LogInit:Display: Failure - 2 error(s), 1566 warning(s)
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.01.31-15.40.12:753] 0]LogInit:Display:
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd:
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: Execution of commandlet took: 1867.18 seconds
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 1878.6385932s to run UE4Editor-Cmd.exe, ExitCode=1
MainFrameActions: Packaging (Windows (64-bit)): Project.Cook: Cook failed. Deleting cooked data.
MainFrameActions: Packaging (Windows (64-bit)): BuildCommand.Execute: ERROR: BUILD FAILED
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: ERROR: AutomationTool terminated with exception:
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: ERROR: Exception in AutomationScripts.Automation: Cook failed.
MainFrameActions: Packaging (Windows (64-bit)): Stacktrace: at Project.Cook(ProjectParams Params)
MainFrameActions: Packaging (Windows (64-bit)): at BuildCookRun.DoBuildCookRun(ProjectParams Params)
MainFrameActions: Packaging (Windows (64-bit)): at BuildCommand.Execute()
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.Automation.Execute(List1 CommandsToExecute, CaselessDictionary1 Commands)
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.Automation.Process(String] CommandLine)
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.Program.MainProc(Object Param)
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.InternalUtils.RunSingleInstance(Action`1 Main, Object Param)
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.Program.Main()InnerException in AutomationUtils.Automation: BUILD FAILED: Failed while running Cook for C:\Users\User\Documents\Unreal Projects\PhotoGallery\PhotoGallery.uproject; see log C:\Users\User\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+4.10\Cook-2016.01.31-15.40.20.txt
MainFrameActions: Packaging (Windows (64-bit)): Stacktrace: at AutomationTool.CommandUtils.RunCommandlet(String ProjectName, String UE4Exe, String Commandlet, String Parameters)
MainFrameActions: Packaging (Windows (64-bit)): at Project.Cook(ProjectParams Params)
MainFrameActions: Packaging (Windows (64-bit)): ProcessManager.KillAll: Trying to kill 0 spawned processes.
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: AutomationTool exiting with ExitCode=Error_UnknownCookFailure
MainFrameActions: Packaging (Windows (64-bit)): Domain_ProcessExit
MainFrameActions: Packaging (Windows (64-bit)): copying UAT log files…
MainFrameActions: Packaging (Windows (64-bit)): RunUAT.bat ERROR: AutomationTool was unable to run successfully.
MainFrameActions: Packaging (Windows (64-bit)): BUILD FAILED
PackagingResults:Error: Error Unknown Cook Failure

ok i think i solved it. i had a couple of blueprint errors on blueprints i wasn’t even using. just in case i fixed those and deleted all the maps i wasn’t using. seemed to fix the cooking failure.
but the packaging is still way too big. i still have the feeling it’s packing things i’m not using.

Yes, I believe the engine will package everything in your project folder. Including things that aren’t even referenced anywhere. This also includes unused blueprints, or parts of blueprints that aren’t called.

So if you want to trim down the file size, you’re gonna have to remove anything you don’t actually need.

Yeah i noticed that. It really sucks. Takes forever to trim down the project. I imported a lot of assets into it from other projects but i’m not using half of them.
Managed to trim down from 3 gb to 500 mb so far. I’ll try to trim it down further.
Wish there was an easier way to do this. Epic should really have UE to just package the assets being used on the maps in the project.

How is this STILL a thing?
Why would it package things that I did not use anywhere in the project?

Write a plugin that does this - make your dreams come true!

(Also sell it for like 2.99 on mktplace)

Hey, is there any way to quickly remove all unused assets yet? Or ignore unused assets when packaging? Going through all project folders&subfolders to delete all unused, unreferenced assets can be very tedious.

You can quickly weed out the assets not being used by migrating the Persistent level into a clean project. Under Windows > level select the Persistent level and migrate it over to a new clean blank project and only assets used in the project is migrate leaving out assets not in use in the PIE.

Sounds good, thank you! I’ll try to do this next time.

Hi FrankieV, maybe its a too simple to do but actually, i dont know how to migrate an existing level in a project to a new blank project, can you explain pls?
Thanks a lot for the help :slight_smile:

Right click on your map file in the content browser, click asset migration (?) and select the content folder of a blank project. (You will need to have created this project prior to the migration). It will then bring along any assets that are in use with the selected map.

Unity3d provides this out of the box with no action required by the developer. I know you can use exclusion .txt files to specify either folders OR specific files for omission but it’s buggy and not 100% clear what params you should use… basically trial and error.

Go to “Packaging” tab in the project settings. Click on the small down arrow at the bottom of packaging settings. Then in “list of maps to include in a packaged build”, add the map you want to package. All assets referenced to this map and assets referenced to those assets, etc. will be packaged but no other asset.
If you don’t add maps here, it will package everything which is in the content folder.

2 Likes

thank you :slight_smile: