Created
June 23, 2025 23:59
-
-
Save robertfsegal/6adc43658d7a7ddc3b22a634a98d1372 to your computer and use it in GitHub Desktop.
Unreal 5 ResavePackages python script example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Unreal | |
| args = [ | |
| # Run the specific commandlet | |
| "-run=ResavePackages", | |
| "-Replace", # Save the asset once fixed up | |
| # Don't show UI | |
| "-NoPause", # Prevents waiting for key presses | |
| "-NoIntro", # Skip intro movies (just in-case) | |
| "-NoSplash", # Don't show the Splash screen | |
| "-Unattended", # Remove UI prompts | |
| # Yes it is ResaveClass, not ResaveClasses, it accepts a comma terminated list, i.e. Blueprint,Actor | |
| #"-ResaveClass=Blueprint", | |
| # Ignore unversioned files (this does not mean source control versioning) | |
| "-IgnoreChangelist", | |
| "-Unversioned", # Ignore asset version mismatches | |
| # Specify which packages we want to consider | |
| "-ProjectOnly", | |
| #"-IgnoreEngine", | |
| "-IgnoreMap", | |
| # '-Package="/Game/Core/"', | |
| #"-DisablePlugin=Wwise,WwiseNiagara,WwiseSoundEngine", # Disable Wwise for now | |
| "-VERIFY", # Show which packages aren't being written because they are read-only | |
| "-SKIPFAILS", | |
| "-ForceResave", # ? | |
| #"-FixupRedirects", | |
| "-AllowReadOnly", # Resave files which are read-only, i.e. P4 will mark files as read-only so we need this | |
| "-IgnoreErrors", # Don't early out due to errors being logged (i.e. Wwise) | |
| # Performance | |
| "-GCFREQ=100", # Reduce frequency of GC (how many packages until it cleans up), can speed up the commandlet | |
| "-NoShaderCompile", # Don't compile shaders | |
| # Perforce settings | |
| "-AutoCheckOut", # Checkout files in P4 before saving | |
| #"-BatchSourceControl", # Batch checkout | |
| "-SkipCheckedOutPackages", # Don't error out on checked out files | |
| # Loading settings - This is slower, but it will prevent some crashes we run into when async loading | |
| "-NoZenLoader", | |
| "-NoAsyncLoadingThread", | |
| # Log | |
| "-log=ResavePackages.txt", | |
| ] | |
| Unreal.run_unreal(args, verbose=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment