bAutoSaveContent
bAutoSaveContent
#Overview
name: bAutoSaveContent
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bAutoSaveContent is to control whether content packages should be automatically saved during an autosave operation in Unreal Engine 5. This setting is part of the editor’s loading and saving system.
This setting variable is primarily used in the UnrealEd module, specifically within the PackageAutoSaver system. It is defined in the EditorLoadingSavingSettings class, which is responsible for managing various editor-related settings.
The value of this variable is set through the Unreal Engine editor’s project settings interface. It is a configuration property, meaning it can be saved and loaded with the project’s configuration files.
bAutoSaveContent interacts with other variables and systems:
- It works in conjunction with bAutoSaveMaps to determine which types of packages should be auto-saved.
- It affects the behavior of the FPackageAutoSaver class, which handles the auto-save functionality.
- It interacts with DirtyContentForAutoSave, which is a collection of content packages that need to be saved.
Developers should be aware of the following when using this variable:
- Enabling this option may increase the time taken for auto-saves, especially in projects with many content packages.
- It affects the performance and disk usage of the editor, as more files will be saved during each auto-save operation.
- The auto-save behavior is also influenced by other settings like AutoSaveMethod and the auto-save time interval.
Best practices when using this variable include:
- Consider the project’s size and complexity when deciding whether to enable content auto-saving.
- Balance the frequency of auto-saves with the potential performance impact on the editor.
- Ensure that team members are aware of the auto-save settings to maintain consistency across the development environment.
- Regularly review and adjust the auto-save settings based on the project’s evolving needs and the team’s workflow.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:177, section: [/Script/UnrealEd.EditorLoadingSavingSettings]
- INI Section:
/Script/UnrealEd.EditorLoadingSavingSettings
- Raw value:
True
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/EditorLoadingSavingSettings.h:176
Scope (from outer to inner):
file
class class UEditorLoadingSavingSettings : public UObject
Source code excerpt:
/** Whether to automatically save content packages during an autosave */
UPROPERTY(EditAnywhere, config, Category=AutoSave, meta=(DisplayName="Save Content"))
uint32 bAutoSaveContent:1;
/** What method should be used when performing an autosave? */
UPROPERTY(EditAnywhere, config, Category=AutoSave, meta=(DisplayName="Save Method"), AdvancedDisplay)
EAutoSaveMethod AutoSaveMethod = EAutoSaveMethod::BackupAndRestore;
/** The time interval after which to auto save */
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/PackageAutoSaver.cpp:267
Scope (from outer to inner):
file
function void FPackageAutoSaver::AttemptAutoSave
Source code excerpt:
SlowTask.EnterProgressFrame(50);
if (LoadingSavingSettings->bAutoSaveContent)
{
AssetsSaveResults = FEditorFileUtils::AutosaveContentPackagesEx(AutoSaveDir, NewAutoSaveIndex, false, DirtyContentForAutoSave);
if (AssetsSaveResults == EAutosaveContentPackagesResult::Success)
{
DirtyContentForAutoSave.Empty();
}
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/PackageAutoSaver.cpp:301
Scope (from outer to inner):
file
function void FPackageAutoSaver::AttemptAutoSave
Source code excerpt:
BackupExistingPackages(DirtyMapsForAutoSave);
}
if (LoadingSavingSettings->bAutoSaveContent)
{
BackupExistingPackages(DirtyContentForAutoSave);
}
}
// Build the complete list of packages to save
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/PackageAutoSaver.cpp:333
Scope (from outer to inner):
file
function void FPackageAutoSaver::AttemptAutoSave
Source code excerpt:
AppendPackagesToSave(DirtyMapsForAutoSave);
}
if (LoadingSavingSettings->bAutoSaveContent)
{
AppendPackagesToSave(DirtyContentForAutoSave);
}
}
if (PackagesToSave.Num() > 0)
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/PackageAutoSaver.cpp:633
Scope (from outer to inner):
file
function bool FPackageAutoSaver::DoPackagesNeedAutoSave
Source code excerpt:
const bool bHasDirtyContentForAutoSave = DirtyContentForAutoSave.Num() != 0;
const bool bWorldsMightBeDirty = LoadingSavingSettings->bAutoSaveMaps && bHasDirtyMapsForAutoSave;
const bool bContentPackagesMightBeDirty = LoadingSavingSettings->bAutoSaveContent && bHasDirtyContentForAutoSave;
const bool bPackagesNeedAutoSave = bWorldsMightBeDirty || bContentPackagesMightBeDirty;
return bPackagesNeedAutoSave;
}
FText FPackageAutoSaver::GetAutoSaveNotificationText(const int32 TimeInSecondsUntilAutosave)
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/PackageAutoSaver.cpp:650
Scope (from outer to inner):
file
function FText FPackageAutoSaver::GetAutoSaveNotificationText
Source code excerpt:
NumPackagesToAutoSave += DirtyMapsForAutoSave.Num();
}
if (DirtyContentForAutoSave.Num() != 0 && LoadingSavingSettings->bAutoSaveContent)
{
NumPackagesToAutoSave += DirtyContentForAutoSave.Num();
}
// Count down the time
FFormatNamedArguments Args;