bExampleLayersAndBlends
bExampleLayersAndBlends
#Overview
name: bExampleLayersAndBlends
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 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bExampleLayersAndBlends is to control the creation of example graphs when generating new Material Layers and Material Layer Blends in Unreal Engine’s material editor.
This setting variable is primarily used within the Material Editor subsystem of Unreal Engine. It is referenced in the MaterialEditor.cpp file, which is part of the Editor module.
The value of this variable is set in the EditorExperimentalSettings class, which is defined in the UnrealEd module. It is a boolean property that can be edited in the project settings under the “Experimental” category.
This variable interacts with the material creation process, specifically when initializing new Material Layers and Material Layer Blends. When enabled, it triggers the creation of example graphs with pre-configured nodes and connections.
Developers should be aware that this is an experimental feature, as indicated by its presence in the EditorExperimentalSettings class. It may not be fully stable or could change in future engine versions.
Best practices when using this variable include:
- Use it primarily for learning and prototyping purposes, as it generates example setups that may not be suitable for production.
- Be cautious when enabling it in a production environment, as it may affect the default state of newly created materials.
- Consider disabling it once you’re familiar with material creation to avoid unnecessary node generation.
- Remember to save any changes made to materials after enabling this setting, as indicated by the code that calls SaveAsset_Execute() when bExampleLayersAndBlends is true and bMaterialDirty is set.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:153, 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/MaterialEditor/Private/MaterialEditor.cpp:708
Scope (from outer to inner):
file
function void FMaterialEditor::InitMaterialEditor
Source code excerpt:
check(!bMaterialDirty);
FVector2D OutputPlacement = FVector2D(200, 300);
if (GetDefault<UEditorExperimentalSettings>()->bExampleLayersAndBlends)
{
switch (MaterialFunction->GetMaterialFunctionUsage())
{
case(EMaterialFunctionUsage::MaterialLayer):
{
OutputPlacement = FVector2D(300, 269);
#Loc: <Workspace>/Engine/Source/Editor/MaterialEditor/Private/MaterialEditor.cpp:753
Scope (from outer to inner):
file
function void FMaterialEditor::InitMaterialEditor
Source code excerpt:
}
if (GetDefault<UEditorExperimentalSettings>()->bExampleLayersAndBlends)
{
UMaterialExpression* SetMaterialAttributes = CreateNewMaterialExpression(UMaterialExpressionSetMaterialAttributes::StaticClass(), FVector2D(40, 300), false, true);
if (Input && SetMaterialAttributes)
{
UMaterialEditingLibrary::ConnectMaterialExpressions(Input, FString(), SetMaterialAttributes, FString());
UMaterialEditingLibrary::ConnectMaterialExpressions(SetMaterialAttributes, FString(), Expression, FString());
#Loc: <Workspace>/Engine/Source/Editor/MaterialEditor/Private/MaterialEditor.cpp:784
Scope (from outer to inner):
file
function void FMaterialEditor::InitMaterialEditor
Source code excerpt:
BaseAttributesInput->bUsePreviewValueAsDefault = true;
}
if (GetDefault<UEditorExperimentalSettings>()->bExampleLayersAndBlends)
{
UMaterialExpression* BlendMaterialAttributes = CreateNewMaterialExpression(UMaterialExpressionBlendMaterialAttributes::StaticClass(), FVector2D(40, 300), false, true);
if (InputTop && InputBottom && BlendMaterialAttributes)
{
UMaterialEditingLibrary::ConnectMaterialExpressions(InputBottom, FString(), BlendMaterialAttributes, FString(TEXT("A")));
UMaterialEditingLibrary::ConnectMaterialExpressions(InputTop, FString(), BlendMaterialAttributes, FString(TEXT("B")));
#Loc: <Workspace>/Engine/Source/Editor/MaterialEditor/Private/MaterialEditor.cpp:863
Scope (from outer to inner):
file
function void FMaterialEditor::InitMaterialEditor
Source code excerpt:
}
if (GetDefault<UEditorExperimentalSettings>()->bExampleLayersAndBlends && bMaterialDirty)
{
SaveAsset_Execute();
}
}
void FMaterialEditor::UpdateGenerator()
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/EditorExperimentalSettings.h:126
Scope (from outer to inner):
file
class class UEditorExperimentalSettings : public UObject
Source code excerpt:
/** When creating new Material Layers and Material Layer Blends, set up example graphs. */
UPROPERTY(EditAnywhere, config, Category = Materials)
bool bExampleLayersAndBlends;
/** Allows creation of assets with paths longer than 260 characters. Note that this also requires the Windows 10 Anniversary Update (1607), and support for long paths to be enabled through the group policy editor. */
UPROPERTY(EditAnywhere, config, Category = "Content Browser", meta = (DisplayName = "Enable support for long paths (> 260 characters)"))
bool bEnableLongPathsSupport;
/** Allows creating APackedLevelActor blueprint actors */