ImportTagsFromConfig
ImportTagsFromConfig
#Overview
name: ImportTagsFromConfig
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 ImportTagsFromConfig is to control whether Unreal Engine should import gameplay tags from configuration files located in the config/tags folder.
This setting variable is primarily used by the Gameplay Tags system, which is a core module in Unreal Engine. It’s also referenced in the VPRoles (Virtual Production Roles) plugin, indicating its importance in virtual production workflows.
The value of this variable is set in multiple places:
- It’s initialized to true in the UGameplayTagsSettings constructor.
- It can be modified through the Unreal Engine editor in the Gameplay Tags settings.
- It’s explicitly set to true in the VPRolesEditorModule::ExtendLevelEditorToolbar function.
ImportTagsFromConfig interacts with other variables in the GameplayTagsSettings class, such as WarnOnInvalidTags and ClearInvalidTags, which control how the engine handles invalid tags during the import process.
Developers should be aware that:
- This setting affects the loading of gameplay tags, which are crucial for many game systems.
- Changing this setting may require a restart of the engine to take effect, as indicated by the config property.
- There’s a deprecated path for this setting in the engine.ini file, which should be avoided in favor of the UGameplayTagsSettings class.
Best practices when using this variable include:
- Generally, keep this setting enabled to ensure all tags defined in config files are imported.
- When adding new tags, make sure they are defined in the appropriate config files if this setting is enabled.
- Be cautious when disabling this setting, as it may lead to missing gameplay tags in your project.
- If you’re working on a project that uses the VPRoles plugin, be aware that it explicitly enables this setting.
- When migrating older projects, check if they’re using the deprecated engine.ini setting and update to use the UGameplayTagsSettings class instead.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:2, section: [/Script/GameplayTags.GameplayTagsSettings]
- INI Section:
/Script/GameplayTags.GameplayTagsSettings
- Raw value:
True
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Experimental/VirtualProduction/VPRoles/Source/VPRolesEditor/Private/VPRolesEditorModule.cpp:72
Scope (from outer to inner):
file
function void FVPRolesEditorModule::ExtendLevelEditorToolbar
Source code excerpt:
if (UGameplayTagsSettings* GameplayTagsSettings = GetMutableDefault<UGameplayTagsSettings>())
{
GameplayTagsSettings->ImportTagsFromConfig = true;
}
UToolMenu* Menu = UToolMenus::Get()->ExtendMenu("LevelEditor.LevelEditorToolBar.User");
FToolMenuEntry VPRolesEntry = FToolMenuEntry::InitComboButton(
"VPRolesMenu",
#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Classes/GameplayTagsSettings.h:102
Scope (from outer to inner):
file
class class UGameplayTagsSettings : public UGameplayTagsList
Source code excerpt:
/** If true, will import tags from ini files in the config/tags folder */
UPROPERTY(config, EditAnywhere, Category = GameplayTags)
bool ImportTagsFromConfig;
/** If true, will give load warnings when reading in saved tag references that are not in the dictionary */
UPROPERTY(config, EditAnywhere, Category = GameplayTags, meta = (ConfigRestartRequired = true))
bool WarnOnInvalidTags;
/** If true, will clear any invalid tags when reading in saved tag references that are not in the dictionary */
#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp:710
Scope (from outer to inner):
file
function bool UGameplayTagsManager::ShouldImportTagsFromINI
Source code excerpt:
// Deprecated path
bool ImportFromINI = false;
if (GConfig->GetBool(TEXT("GameplayTags"), TEXT("ImportTagsFromConfig"), ImportFromINI, GEngineIni))
{
if (ImportFromINI)
{
MutableDefault->ImportTagsFromConfig = ImportFromINI;
UE_LOG(LogGameplayTags, Log, TEXT("ImportTagsFromConfig is in a deprecated location, open and save GameplayTag settings to fix"));
}
return ImportFromINI;
}
return MutableDefault->ImportTagsFromConfig;
}
bool UGameplayTagsManager::ShouldUnloadTags() const
{
#if WITH_EDITOR
if (bShouldAllowUnloadingTags && GIsEditor && GEngine)
#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsSettings.cpp:61
Scope (from outer to inner):
file
function UGameplayTagsSettings::UGameplayTagsSettings
Source code excerpt:
{
ConfigFileName = GetDefaultConfigFilename();
ImportTagsFromConfig = true;
WarnOnInvalidTags = true;
ClearInvalidTags = false;
FastReplication = false;
AllowEditorTagUnloading = true;
AllowGameTagUnloading = false;
InvalidTagCharacters = ("\"',");