OutputNamespaces

OutputNamespaces

#Overview

name: OutputNamespaces

The value of this variable can be defined or overridden in .ini config files. 7 .ini config files referencing this setting variable.

It is referenced in 9 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of OutputNamespaces is to store and manage a list of valid namespaces for reading parameters in the Niagara visual effects system within Unreal Engine 5. This variable is primarily used in the context of parameter management and localization.

OutputNamespaces is mainly utilized by the Niagara plugin and the Localization module of Unreal Engine 5. It plays a crucial role in the following subsystems:

  1. Niagara Visual Effects System: It helps define valid parameter namespaces for different script contexts.
  2. Localization System: It’s used in gathering text from metadata for localization purposes.

The value of this variable is typically set within functions like GetValidNamespacesForReading in the Niagara system and during the configuration of localization gather tasks.

OutputNamespaces interacts with other variables such as InputKeys and OutputKeys, particularly in the localization system. In the Niagara system, it’s often used in conjunction with script usage flags and parameter variables.

Developers should be aware that:

  1. The content of OutputNamespaces can vary depending on the script context in Niagara.
  2. In localization, OutputNamespaces is crucial for defining the namespace of gathered text.
  3. The order and content of OutputNamespaces should match corresponding InputKeys and OutputKeys in localization tasks.

Best practices when using this variable include:

  1. Ensure that all necessary namespaces are included for the specific script context in Niagara.
  2. In localization tasks, carefully configure OutputNamespaces to match your project’s localization structure.
  3. When adding custom namespaces, follow the existing naming conventions and structure.
  4. Regularly review and update the namespaces as your project evolves to maintain consistency and prevent conflicts.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/Localization/Category.ini:38, section: [GatherTextStep0]

Location: <Workspace>/Engine/Config/Localization/Editor.ini:79, section: [GatherTextStep2]

Location: <Workspace>/Engine/Config/Localization/Editor.ini:82, section: [GatherTextStep2]

Location: <Workspace>/Engine/Config/Localization/Keywords.ini:33, section: [GatherTextStep0]

Location: <Workspace>/Engine/Config/Localization/PropertyNames.ini:38, section: [GatherTextStep0]

Location: <Workspace>/Engine/Config/Localization/ToolTips.ini:38, section: [GatherTextStep0]

Location: <Workspace>/Engine/Config/Localization/ToolTips.ini:41, section: [GatherTextStep0]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/NiagaraEditor/Private/NiagaraParameterMapHistory.cpp:186

Scope (from outer to inner):

file
function     void FNiagaraParameterUtilities::GetValidNamespacesForReading

Source code excerpt:

}

void FNiagaraParameterUtilities::GetValidNamespacesForReading(const UNiagaraScript* InScript, TArray<FString>& OutputNamespaces)
{
	GetValidNamespacesForReading(InScript->GetUsage(), 0, OutputNamespaces);
}

void FNiagaraParameterUtilities::GetValidNamespacesForReading(ENiagaraScriptUsage InScriptUsage, int32 InUsageBitmask, TArray<FString>& OutputNamespaces)
{
	TArray<ENiagaraScriptUsage> SupportedContexts;
	SupportedContexts.Add(InScriptUsage);
	if (UNiagaraScript::IsStandaloneScript(InScriptUsage))
	{
		SupportedContexts.Append(UNiagaraScript::GetSupportedUsageContextsForBitmask(InUsageBitmask));
	}

	OutputNamespaces.Add(PARAM_MAP_MODULE_STR);
	OutputNamespaces.Add(PARAM_MAP_ENGINE_STR);
	OutputNamespaces.Add(PARAM_MAP_NPC_STR);
	OutputNamespaces.Add(PARAM_MAP_USER_STR);
	OutputNamespaces.Add(PARAM_MAP_SYSTEM_STR);
	OutputNamespaces.Add(PARAM_MAP_EMITTER_STR);
	OutputNamespaces.Add(PARAM_MAP_INDICES_STR);

	for (ENiagaraScriptUsage Usage : SupportedContexts)
	{
		if (UNiagaraScript::IsParticleScript(Usage))
		{
			OutputNamespaces.Add(PARAM_MAP_ATTRIBUTE_STR);
			break;
		}
	}
}

FString FNiagaraParameterUtilities::GetNamespace(const FNiagaraVariable& InVar, bool bIncludeDelimiter)

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/NiagaraEditor/Private/NiagaraParameterMapHistory.cpp:237

Scope (from outer to inner):

file
function     bool FNiagaraParameterUtilities::IsValidNamespaceForReading

Source code excerpt:

bool FNiagaraParameterUtilities::IsValidNamespaceForReading(ENiagaraScriptUsage InScriptUsage, int32 InUsageBitmask, FString Namespace)
{
	TArray<FString> OutputNamespaces;
	GetValidNamespacesForReading(InScriptUsage, InUsageBitmask, OutputNamespaces);

	TArray<FString> ConcernedNamespaces;
	ConcernedNamespaces.Add(PARAM_MAP_MODULE_STR);
	ConcernedNamespaces.Add(PARAM_MAP_ENGINE_STR);
	ConcernedNamespaces.Add(PARAM_MAP_NPC_STR);
	ConcernedNamespaces.Add(PARAM_MAP_USER_STR);

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/NiagaraEditor/Private/NiagaraParameterMapHistory.cpp:257

Scope (from outer to inner):

file
function     bool FNiagaraParameterUtilities::IsValidNamespaceForReading

Source code excerpt:


	// Pass if we are in the allowed list
	for (const FString& ValidNamespace : OutputNamespaces)
	{
		if (Namespace.StartsWith(ValidNamespace))
		{
			return true;
		}
	}

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/NiagaraEditor/Public/NiagaraParameterMapHistory.h:193

Scope (from outer to inner):

file
namespace    FNiagaraParameterUtilities

Source code excerpt:

	bool IsInNamespace(const FNiagaraVariableBase& InVar, const FString& Namespace);

	void GetValidNamespacesForReading(const UNiagaraScript* InScript, TArray<FString>& OutputNamespaces);
	void GetValidNamespacesForReading(ENiagaraScriptUsage InScriptUsage, int32 InUsageBitmask, TArray<FString>& OutputNamespaces);
	bool IsValidNamespaceForReading(ENiagaraScriptUsage InScriptUsage, int32 InUsageBitmask, FString Namespace);
	bool IsWrittenToScriptUsage(const FNiagaraVariable& InVar, ENiagaraScriptUsage InUsage, bool bAllowDataInterfaces);

	/** Are we required to export this variable as an external constant?*/
	bool IsExportableExternalConstant(const FNiagaraVariable& InVar, const UNiagaraScript* InScript);

#Loc: <Workspace>/Engine/Source/Developer/Localization/Private/LocalizationConfigurationScript.cpp:429

Scope (from outer to inner):

file
namespace    LocalizationConfigurationScript
function     FLocalizationConfigurationScript GenerateGatherTextConfigFile

Source code excerpt:

			{
				ConfigSection.Add( TEXT("InputKeys"), Specification.MetaDataKey.Name );
				ConfigSection.Add( TEXT("OutputNamespaces"), Specification.TextNamespace );
				ConfigSection.Add( TEXT("OutputKeys"), Specification.TextKeyPattern.Pattern );
			}

			// Field Type Filters
			for (const FString& FieldTypeToInclude : Target->Settings.GatherFromMetaData.FieldTypesToInclude)
			{

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Commandlets/GatherTextFromMetadataCommandlet.h:27

Scope (from outer to inner):

file
class        class UGatherTextFromMetaDataCommandlet : public UGatherTextCommandletBase

Source code excerpt:

	{
		TArray<FString> InputKeys;
		TArray<FString> OutputNamespaces;
		TArray<FString> OutputKeys;
	};

private:
	void GatherTextFromUObjects(const TArray<FString>& IncludePaths, const TArray<FString>& ExcludePaths, const FGatherParameters& Arguments);

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Commandlets/GatherTextFromMetadataCommandlet.cpp:263

Scope (from outer to inner):

file
function     int32 UGatherTextFromMetaDataCommandlet::Main

Source code excerpt:

	FGatherParameters Arguments;
	GetStringArrayFromConfig(*SectionName, TEXT("InputKeys"), Arguments.InputKeys, GatherTextConfigPath);
	GetStringArrayFromConfig(*SectionName, TEXT("OutputNamespaces"), Arguments.OutputNamespaces, GatherTextConfigPath);
	GetStringArrayFromConfig(*SectionName, TEXT("OutputKeys"), Arguments.OutputKeys, GatherTextConfigPath);

	// Execute gather.
	GatherTextFromUObjects(IncludePathFilters, ExcludePathFilters, Arguments);

	// Add any manifest dependencies if they were provided

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Commandlets/GatherTextFromMetadataCommandlet.cpp:362

Scope (from outer to inner):

file
function     void UGatherTextFromMetaDataCommandlet::GatherTextFromField

Source code excerpt:

							PatternArguments.Add(TEXT("MetaDataValue"), MetaDataValue);

							const FString Namespace = Arguments.OutputNamespaces[j];
							FLocItem LocItem(MetaDataValue);
							FManifestContext Context;
							Context.Key = FString::Format(*Arguments.OutputKeys[j], PatternArguments);
							Context.SourceLocation = FString::Printf(TEXT("Meta-data for key %s of enum value %s of enum %s in %s"), *Arguments.InputKeys[j], *Enum->GetNameStringByIndex(i), *Enum->GetName(), *Enum->GetFullGroupName(true));
							Context.PlatformName = InPlatformName;
							GatherManifestHelper->AddSourceText(Namespace, LocItem, Context);

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Commandlets/GatherTextFromMetadataCommandlet.cpp:451

Scope (from outer to inner):

file
function     void UGatherTextFromMetaDataCommandlet::GatherTextFromFieldImpl

Source code excerpt:


				const UStruct* FieldOwnerType = Field->GetOwnerStruct();
				const FString Namespace = Arguments.OutputNamespaces[i];
				FLocItem LocItem(MetaDataValue);
				FManifestContext Context;
				Context.Key = FString::Format(*Arguments.OutputKeys[i], PatternArguments);
				Context.SourceLocation = FString::Printf(TEXT("Meta-data for key %s of member %s in %s (type: %s, owner: %s)"), *Arguments.InputKeys[i], *Field->GetName(), *Field->GetFullGroupName(true), *Field->GetClass()->GetName(), FieldOwnerType ? *FieldOwnerType->GetName() : TEXT("<null>"));
				Context.PlatformName = InPlatformName;
				GatherManifestHelper->AddSourceText(Namespace, LocItem, Context);