Editor.AsyncStaticMeshCompilationFinishAll
Editor.AsyncStaticMeshCompilationFinishAll
#Overview
name: Editor.AsyncStaticMeshCompilationFinishAll
This variable is created as a Console Variable (cvar).
- type:
Cmd
- help:
Finish all static meshes compilations
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Editor.AsyncStaticMeshCompilationFinishAll is to control the asynchronous compilation of static meshes in the Unreal Engine editor. This setting is part of the performance optimization system for static mesh processing.
-
The variable is primarily used in the Engine’s StaticMeshCompiler module, specifically in the StaticMeshCompilingManagerImpl namespace.
-
The value of this variable is set through the UEditorExperimentalSettings class, which is part of the UnrealEd module. It’s associated with the bEnableAsyncStaticMeshCompilation boolean property.
-
This variable interacts with other async compilation-related variables, such as CVarAsyncStaticMeshStandard.AsyncCompilation and CVarAsyncStaticMeshStandard.AsyncCompilationMaxConcurrency.
-
Developers should be aware that this setting is experimental and may affect the stability and performance of the editor. It’s important to test thoroughly when enabling this feature.
-
Best practices when using this variable include:
- Enable it only when working on projects with many static meshes that require frequent compilation.
- Monitor performance and stability after enabling to ensure it’s beneficial for your specific project.
- Be prepared to disable it if you encounter any issues with static mesh compilation or editor performance.
Regarding the associated variable bEnableAsyncStaticMeshCompilation:
- This is a boolean property in the UEditorExperimentalSettings class.
- It’s purpose is to enable or disable async static mesh compilation and loading to improve import and map load time performance.
- The variable is part of the editor’s project-specific user settings.
- It’s used in conjunction with other async compilation settings for various asset types (textures, skinned assets, sound waves).
- Developers should be cautious when enabling this setting, as it’s in the experimental category and may have unforeseen effects on editor behavior.
- Best practices include:
- Enable this setting in a testing environment before applying it to production projects.
- Use in combination with other async compilation settings for a comprehensive performance boost.
- Monitor the impact on import times and map load performance after enabling.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/StaticMeshCompiler.cpp:69
Scope (from outer to inner):
file
namespace StaticMeshCompilingManagerImpl
function static void EnsureInitializedCVars
Source code excerpt:
AsyncCompilationHelpers::EnsureInitializedCVars(
TEXT("staticmesh"),
CVarAsyncStaticMeshStandard.AsyncCompilation,
CVarAsyncStaticMeshStandard.AsyncCompilationMaxConcurrency,
GET_MEMBER_NAME_CHECKED(UEditorExperimentalSettings, bEnableAsyncStaticMeshCompilation));
}
}
}
#Associated Variable and Callsites
This variable is associated with another variable named bEnableAsyncStaticMeshCompilation
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/EditorExperimentalSettings.h:14
Scope (from outer to inner):
file
class class UEditorExperimentalSettings : public UObject
Source code excerpt:
*/
UCLASS(config=EditorPerProjectUserSettings, MinimalAPI)
class UEditorExperimentalSettings
: public UObject
{
GENERATED_UCLASS_BODY()
public:
/** Enable async texture compilation to improve PIE and map load time performance when compilation is required */
UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async texture compilation and loading"))
bool bEnableAsyncTextureCompilation;
/** Enable async static mesh compilation to improve import and map load time performance when compilation is required */
UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async static mesh compilation and loading"))
bool bEnableAsyncStaticMeshCompilation;
/** Enable async skeletal mesh compilation to improve import and map load time performance when compilation is required */
UE_DEPRECATED(5.1, "Deprecated & replaced by bEnableAsyncSkinnedAssetCompilation.")
UPROPERTY(/*EditAnywhere - deprecated & replaced by bEnableAsyncSkinnedAssetCompilation, */config/*, Category = Performance, meta = (DisplayName = "Enable async skeletal mesh compilation and loading")*/)
bool bEnableAsyncSkeletalMeshCompilation;
/** Enable async skinned asset compilation to improve import and map load time performance when compilation is required */
UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async skinned asset compilation and loading"))
bool bEnableAsyncSkinnedAssetCompilation;
/** Enable async sound compilation to improve import and map load time performance when compilation is required */
UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async sound compilation and loading"))
bool bEnableAsyncSoundWaveCompilation;
/** Allows the editor to run on HDR monitors on Windows 10 */
UPROPERTY(EditAnywhere, config, Category = HDR, meta = (ConfigRestartRequired = true, DisplayName = "Enable Editor Support for HDR Monitors"))
bool bHDREditor;
/** The brightness of the slate UI on HDR monitors */
UPROPERTY(EditAnywhere, config, Category = HDR, meta = (ClampMin = "100.0", ClampMax = "300.0", UIMin = "100.0", UIMax = "300.0"))
float HDREditorNITLevel;
/** Allows usage of the procedural foliage system */
UPROPERTY(EditAnywhere, config, Category = Foliage, meta = (DisplayName = "Procedural Foliage"))
bool bProceduralFoliage;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:172
Scope (from outer to inner):
file
function UEditorExperimentalSettings::UEditorExperimentalSettings
Source code excerpt:
TEXT("Editor.HDRSupport"),
0,
TEXT("Sets whether or not we should allow the editor to run on HDR monitors"),
ECVF_Default);
static TAutoConsoleVariable<float> CVarEditorHDRNITLevel(
TEXT("Editor.HDRNITLevel"),
160.0f,
TEXT("Sets The desired NIT level of the editor when running on HDR"),
ECVF_Default);
UEditorExperimentalSettings::UEditorExperimentalSettings( const FObjectInitializer& ObjectInitializer )
: Super(ObjectInitializer)
, bEnableAsyncTextureCompilation(false)
, bEnableAsyncStaticMeshCompilation(false)
, bEnableAsyncSkeletalMeshCompilation(true) // This was false and set to True in /Engine/Config/BaseEditorPerProjectUserSettings.ini. The setting is removed from .ini so change it to default True.
, bEnableAsyncSkinnedAssetCompilation(false)
, bEnableAsyncSoundWaveCompilation(false)
, bHDREditor(false)
, HDREditorNITLevel(160.0f)
, bUseOpenCLForConvexHullDecomp(false)
, bAllowPotentiallyUnsafePropertyEditing(false)
, bPackedLevelActor(true)
, bLevelInstance(true)
{
}
void UEditorExperimentalSettings::PostInitProperties()
{
PRAGMA_DISABLE_DEPRECATION_WARNINGS
// bEnableAsyncSkeletalMeshCompilation's default to True (see comment in constructor above).
// To be backwards compatible, if a user project overrides it to False, pass on the value to bEnableAsyncSkinnedAssetCompilation.
if (!bEnableAsyncSkeletalMeshCompilation)
{
UE_LOG(LogSettingsClasses, Warning, TEXT("bEnableAsyncSkeletalMeshCompilation is deprecated and replaced with bEnableAsyncSkinnedAssetCompilation. Please update the config. Setting bEnableAsyncSkinnedAssetCompilation to False."));
bEnableAsyncSkinnedAssetCompilation = false;
}
PRAGMA_ENABLE_DEPRECATION_WARNINGS
CVarEditorHDRSupport->Set(bHDREditor ? 1 : 0, ECVF_SetByProjectSetting);
CVarEditorHDRNITLevel->Set(HDREditorNITLevel, ECVF_SetByProjectSetting);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/StaticMeshCompiler.cpp:60
Scope (from outer to inner):
file
namespace StaticMeshCompilingManagerImpl
function static void EnsureInitializedCVars
Source code excerpt:
namespace StaticMeshCompilingManagerImpl
{
static void EnsureInitializedCVars()
{
static bool bIsInitialized = false;
if (!bIsInitialized)
{
bIsInitialized = true;
AsyncCompilationHelpers::EnsureInitializedCVars(
TEXT("staticmesh"),
CVarAsyncStaticMeshStandard.AsyncCompilation,
CVarAsyncStaticMeshStandard.AsyncCompilationMaxConcurrency,
GET_MEMBER_NAME_CHECKED(UEditorExperimentalSettings, bEnableAsyncStaticMeshCompilation));
}
}
}
FStaticMeshCompilingManager::FStaticMeshCompilingManager()
: Notification(MakeUnique<FAsyncCompilationNotification>(GetAssetNameFormat()))
{
StaticMeshCompilingManagerImpl::EnsureInitializedCVars();
PostReachabilityAnalysisHandle = FCoreUObjectDelegates::PostReachabilityAnalysis.AddRaw(this, &FStaticMeshCompilingManager::OnPostReachabilityAnalysis);
}
void FStaticMeshCompilingManager::OnPostReachabilityAnalysis()
{
if (GetNumRemainingMeshes())
{
TRACE_CPUPROFILER_EVENT_SCOPE(FStaticMeshCompilingManager::CancelUnreachableMeshes);
TArray<UStaticMesh*> PendingStaticMeshes;
PendingStaticMeshes.Reserve(GetNumRemainingMeshes());
for (auto Iterator = RegisteredStaticMesh.CreateIterator(); Iterator; ++Iterator)
{
UStaticMesh* StaticMesh = Iterator->GetEvenIfUnreachable();
if (StaticMesh && StaticMesh->IsUnreachable())
{