I have doubts regarding ResavePackages commandlet and what needs to be done when changing Engine version (5.7 -> 5.8 in this case).
As far as I can understand if an asset has
File Version: 1018
Engine Version: 5.7.4-1815580+++someproject+main
and with ResavePackage I use -CHECKUE4VER then the resave is skipped.
When switching from 5.7 to 5.8 should we resave all assets by not using -CHECKUE4VER or does the fact that they have the same version (1018) mean they do not need to be resaved?
If we should resave all assets, seeing that we almost always have some assets not resaved (due to issues or because in checkout) is there a method to resave only assets that were not saved as 5.8?
That option checks for the package file version which is a global flag. We only update it when a change affects the all assets. There are a bunch of custom version GUIDs that are related to feature specific changes and that are used in the custom Seialize methods to manage schema updates. You should not use CHECKUE4VER in the case of 5.7 -> 5.8 as this prevents any resave as you already found out.
There is -OnlySaveDirtyPackages that appears to be there to limit the number of resave but it relies on the upgrade code explicitly calling MarkPackageDirty which might not be the case for some changes. That flag can be misleading so you should also not use it.
My recommendation would be to go for a full resave to ensure that all the assets are saved using the latest code.
You can use the PkgInfo commandlet to generate a report from the uasset headers. I don’t know how long it will take. Here is the command for one of my local projects:
Engine\Binaries\Win64\UnrealEditor-Cmd.exe "D:/P4/Release58/Custom58/Custom58.uproject" -run=PkgInfo -AllPackagesIn="D:/P4/Release58/Custom58/Content" -HideOffsets -dumptofile="D:/P4/Release58/Custom58/Saved/PkgInfo.txt" -unattended -nop4 -nosplashJust make sure that the project’s editor target is up to date, ie recently compiled.
You don’t need to resave for hotfixes (patch). Our internal rules forbid that we change the binary schema of the asset for those. The resave is not mandatory when upgrading to a newer main release (5.7.x -> 5.8.y). The engine code can always read data saved with the previous release. It gets muddy when jumping releases as the code in the Serialize method is not specifically written or tested to handle it. I’m making it worse than it actually is. I have never seen a case where old data cannot be read in all my time at Epic. I’m aware of project that were update from 4.27 to 5.5\5.6 directly.
The resave is useful because it ensures that the data is using the latest schema so you are not paying for the update\conversion cost every time the asset is loaded.
Is there a quick method to see the Engine Version of the assets? AI gave me a Powershell method, but it takes over 2 hours to create the list of all assets.
Do you think all assets should be resaved also when there is a patch (for example 5.8.1 -> 5.8.2)?