bUseWidgetTemplateSelector

bUseWidgetTemplateSelector

#Overview

name: bUseWidgetTemplateSelector

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

It is referenced in 8 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bUseWidgetTemplateSelector is to control whether a dialog for selecting a root widget is displayed when creating a new Widget Blueprint in Unreal Engine 5’s UMG (Unreal Motion Graphics) system.

This setting variable is primarily used in the UMG Editor module and the Blutility module, which are part of Unreal Engine’s editor tools for creating user interfaces and editor utility widgets.

The value of this variable is set in the UWidgetEditingProjectSettings class constructor, where it’s initialized to false by default. It can be modified through the project settings in the Unreal Engine editor.

This variable interacts with other settings such as CommonRootWidgetClasses and DefaultRootWidget. When bUseWidgetTemplateSelector is false, the system uses the DefaultRootWidget as the root widget for new Widget Blueprints.

Developers should be aware that this setting affects the workflow for creating new Widget Blueprints. When enabled, it provides more flexibility in choosing the root widget, but it also adds an extra step to the creation process.

Best practices for using this variable include:

  1. Enable it if your project frequently uses different types of root widgets for various UI elements.
  2. Keep it disabled if your project consistently uses the same type of root widget (like UCanvasPanel) to streamline the creation process.
  3. If enabled, carefully curate the CommonRootWidgetClasses list to include the most frequently used panel widgets in your project.
  4. Consider the impact on your team’s workflow before changing this setting, as it affects how all team members create new Widget Blueprints.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditor.ini:658, section: [/Script/Blutility.EditorUtilityWidgetProjectSettings]

Location: <Workspace>/Projects/Lyra/Config/DefaultEditor.ini:31, section: [/Script/UMGEditor.UMGEditorProjectSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/Blutility/Private/EditorUtilityWidgetBlueprintFactory.cpp:75

Scope (from outer to inner):

file
function     bool UEditorUtilityWidgetBlueprintFactory::ConfigureProperties

Source code excerpt:

bool UEditorUtilityWidgetBlueprintFactory::ConfigureProperties()
{
	if (GetDefault<UEditorUtilityWidgetProjectSettings>()->bUseWidgetTemplateSelector)
	{
		// Load the classviewer module to display a class picker
		FClassViewerModule& ClassViewerModule = FModuleManager::LoadModuleChecked<FClassViewerModule>("ClassViewer");

		// Fill in options
		FClassViewerInitializationOptions Options;

#Loc: <Workspace>/Engine/Source/Editor/Blutility/Private/EditorUtilityWidgetBlueprintFactory.cpp:133

Scope (from outer to inner):

file
function     UObject* UEditorUtilityWidgetBlueprintFactory::FactoryCreateNew

Source code excerpt:

	{
		// If the root widget selection dialog is not enabled, use a canvas panel as the root by default
		if (!GetDefault<UEditorUtilityWidgetProjectSettings>()->bUseWidgetTemplateSelector)
		{
			RootWidgetClass = UCanvasPanel::StaticClass();
		}
		UEditorUtilityWidgetBlueprint* NewBP = CastChecked<UEditorUtilityWidgetBlueprint>(FKismetEditorUtilities::CreateBlueprint(ParentClass, InParent, Name, BlueprintType, UEditorUtilityWidgetBlueprint::StaticClass(), UWidgetBlueprintGeneratedClass::StaticClass(), NAME_None));

		// Create the selected root widget

#Loc: <Workspace>/Engine/Source/Editor/Blutility/Private/EditorUtilityWidgetSettingsCustomization.cpp:20

Scope (from outer to inner):

file
function     void FEditorUtilityWidgetSettingsCustomization::CustomizeDetails

Source code excerpt:


	// Hide properties where we don't want the Editor Utility Widget settings to differ from the standard UMG ones
	TSharedPtr<IPropertyHandle> TemplateSelectorProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UWidgetEditingProjectSettings, bUseWidgetTemplateSelector), UWidgetEditingProjectSettings::StaticClass());
	TemplateSelectorProperty->MarkHiddenByCustomization();
	TSharedPtr<IPropertyHandle> MakeVariableProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UWidgetEditingProjectSettings, bEnableMakeVariable), UWidgetEditingProjectSettings::StaticClass());
	MakeVariableProperty->MarkHiddenByCustomization();
	TSharedPtr<IPropertyHandle> WidgetAnimationWindowProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UWidgetEditingProjectSettings, bEnableWidgetAnimationEditor), UWidgetEditingProjectSettings::StaticClass());
	WidgetAnimationWindowProperty->MarkHiddenByCustomization();
	TSharedPtr<IPropertyHandle> PaletteWindowProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UWidgetEditingProjectSettings, bEnablePaletteWindow), UWidgetEditingProjectSettings::StaticClass());

#Loc: <Workspace>/Engine/Source/Editor/UMGEditor/Private/Settings/UMGEditorProjectSettings.cpp:31

Scope (from outer to inner):

file
function     UUMGEditorProjectSettings::UUMGEditorProjectSettings

Source code excerpt:

	bUseUserWidgetParentDefaultClassViewerSelector = true;

	bUseWidgetTemplateSelector = false;
	CommonRootWidgetClasses = {
		UHorizontalBox::StaticClass(),
		UVerticalBox::StaticClass(),
		UGridPanel::StaticClass(),
		UCanvasPanel::StaticClass()
	};

#Loc: <Workspace>/Engine/Source/Editor/UMGEditor/Private/Settings/WidgetEditingProjectSettings.cpp:29

Scope (from outer to inner):

file
function     UWidgetEditingProjectSettings::UWidgetEditingProjectSettings

Source code excerpt:

	bUseUserWidgetParentDefaultClassViewerSelector = true;

	bUseWidgetTemplateSelector = false;
}

bool UWidgetEditingProjectSettings::CompilerOption_AllowBlueprintTick(const class UWidgetBlueprint* WidgetBlueprint) const
{
	return GetFirstCompilerOption(WidgetBlueprint, &FWidgetCompilerOptions::bAllowBlueprintTick, true);
}

#Loc: <Workspace>/Engine/Source/Editor/UMGEditor/Private/WidgetBlueprintFactory.cpp:107

Scope (from outer to inner):

file
function     bool UWidgetBlueprintFactory::ConfigureProperties

Source code excerpt:

	}

	if (GetDefault<UUMGEditorProjectSettings>()->bUseWidgetTemplateSelector)
	{
		// Load the classviewer module to display a class picker
		FClassViewerModule& ClassViewerModule = FModuleManager::LoadModuleChecked<FClassViewerModule>("ClassViewer");

		// Fill in options
		FClassViewerInitializationOptions Options;

#Loc: <Workspace>/Engine/Source/Editor/UMGEditor/Private/WidgetBlueprintFactory.cpp:179

Scope (from outer to inner):

file
function     UObject* UWidgetBlueprintFactory::FactoryCreateNew

Source code excerpt:

	else
	{
		if (!GetDefault<UUMGEditorProjectSettings>()->bUseWidgetTemplateSelector)
		{
			RootWidgetClass = GetDefault<UUMGEditorProjectSettings>()->DefaultRootWidget;
		}

		UWidgetBlueprint* NewBP = CastChecked<UWidgetBlueprint>(FKismetEditorUtilities::CreateBlueprint(CurrentParentClass, InParent, Name, BlueprintType, UWidgetBlueprint::StaticClass(), UWidgetBlueprintGeneratedClass::StaticClass(), CallingContext));

#Loc: <Workspace>/Engine/Source/Editor/UMGEditor/Public/WidgetEditingProjectSettings.h:155

Scope (from outer to inner):

file
class        class UWidgetEditingProjectSettings : public UDeveloperSettings

Source code excerpt:

	/** Enables a dialog that lets you select a root widget before creating a widget blueprint */
	UPROPERTY(EditAnywhere, config, Category = "Designer")
	bool bUseWidgetTemplateSelector;

	/** This list populates the common class section of the root widget selection dialog */
	UPROPERTY(EditAnywhere, config, Category = "Designer", meta = (EditCondition = "bUseWidgetTemplateSelector"))
	TArray<TSoftClassPtr<UPanelWidget>> CommonRootWidgetClasses;

	/** The panel widget to place at the root of all newly constructed widget blueprints. Can be empty. */