bDisableCookInEditor
bDisableCookInEditor
#Overview
name: bDisableCookInEditor
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 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bDisableCookInEditor is to control whether the Cook In The Editor feature is enabled or disabled. This setting is primarily related to the cooking process in Unreal Engine, which is responsible for preparing game content for distribution.
This setting variable is utilized by the UnrealEd module, specifically within the cooking and editor subsystems. It’s referenced in the CookOnTheFlyServer, EditorExperimentalSettings, UnrealEdEngine, and UnrealEdMisc classes.
The value of this variable is set in the EditorExperimentalSettings class, where it’s defined as a UPROPERTY with config metadata, indicating that it’s configurable through the editor’s settings interface.
This variable interacts with other cooking-related variables and systems, such as CookOnTheFlyServer and CookByTheBookStartupOptions. It also affects the initialization of the cook server in the UnrealEdEngine.
Developers must be aware that changing this variable requires a restart of the editor to take effect, as indicated by the ConfigRestartRequired metadata. When disabled, cooks initiated from the editor will be run in a separate process.
Best practices when using this variable include:
- Consider the impact on build times and editor performance when enabling or disabling this feature.
- Be aware that disabling this feature may affect workflows that rely on in-editor cooking.
- Ensure that all team members are aware of the current setting to maintain consistent development environments.
- When disabled, make sure your project is set up correctly to handle cooking in a separate process.
- Consider the implications on package dependency tracking, as seen in the UnrealEdMisc initialization.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:162, section: [/Script/UnrealEd.EditorExperimentalSettings]
- INI Section:
/Script/UnrealEd.EditorExperimentalSettings
- 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/CookOnTheSide/CookOnTheFlyServer.h:914
Scope: file
Source code excerpt:
/**
* Initialization for systems that persist across CookSessions but that are not available during Initialize(which
* can occur during EngineStartup if !bDisableCookInEditor). We initialize these as late as possible: at the
* beginning of the first session, or for CookOnTheFly at the first cook request.
*/
void InitializeAtFirstSession();
/** Initialize steps that are reexecuted at the beginning of every cook session. */
void InitializeSession();
//////////////////////////////////////////////////////////////////////////
// cook by the book specific functions
const FCookByTheBookStartupOptions& BlockOnPrebootCookGate(bool& bOutAbortCook,
const FCookByTheBookStartupOptions& CookByTheBookStartupOptions,
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/EditorExperimentalSettings.h:79
Scope (from outer to inner):
file
class class UEditorExperimentalSettings : public UObject
Source code excerpt:
/** Disable cook in the editor */
UPROPERTY(EditAnywhere, config, Category = Cooking, meta = (DisplayName = "Disable Cook In The Editor feature (cooks from launch on will be run in a separate process if disabled)", ConfigRestartRequired=true))
bool bDisableCookInEditor;
UPROPERTY(EditAnywhere, config, Category = Cooking, meta = (DisplayName = "Use shared cooked builds in launch on", ConfigRestartRequired = true))
bool bSharedCookedBuilds;
/** Enable late joining in PIE */
UPROPERTY(EditAnywhere, config, Category = PIE, meta = (DisplayName = "Allow late joining"))
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/UnrealEdEngine.cpp:270
Scope (from outer to inner):
file
function void UUnrealEdEngine::Init
Source code excerpt:
CookServer->StartCookOnTheFly(CookOnTheFlyStartupOptions);
}
else if (!ExperimentalSettings->bDisableCookInEditor)
{
CookServer = NewObject<UCookOnTheFlyServer>();
CookServer->Initialize(ECookMode::CookByTheBookFromTheEditor, BaseCookingFlags);
}
#if WITH_COTF
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/UnrealEdMisc.cpp:223
Scope (from outer to inner):
file
function FUnrealEdMisc::FUnrealEdMisc
Source code excerpt:
//This is an early entry-point into the UnrealEd module to perform some editor-specific configuration
#if UE_WITH_PACKAGE_ACCESS_TRACKING
const bool bBuildDependencyTrackingNeeded = GIsEditor && (IsRunningCookCommandlet() || !GetDefault<UEditorExperimentalSettings>()->bDisableCookInEditor);
if (!bBuildDependencyTrackingNeeded)
{
FPackageBuildDependencyTracker::Get().Disable();
}
#endif
}