2019-12-26 15:33:43 -05:00
// Copyright Epic Games, Inc. All Rights Reserved.
2018-11-06 18:07:24 -05:00
# include "SMaterialParametersOverviewWidget.h"
# include "MaterialEditor/DEditorFontParameterValue.h"
# include "MaterialEditor/DEditorMaterialLayersParameterValue.h"
# include "MaterialEditor/DEditorScalarParameterValue.h"
# include "MaterialEditor/DEditorStaticComponentMaskParameterValue.h"
# include "MaterialEditor/DEditorStaticSwitchParameterValue.h"
# include "MaterialEditor/DEditorTextureParameterValue.h"
# include "MaterialEditor/DEditorVectorParameterValue.h"
# include "MaterialEditor/MaterialEditorInstanceConstant.h"
# include "Materials/Material.h"
# include "PropertyHandle.h"
# include "Modules/ModuleManager.h"
# include "PropertyEditorModule.h"
# include "ISinglePropertyView.h"
# include "Materials/MaterialInstanceConstant.h"
2022-05-09 13:12:28 -04:00
# include "Styling/AppStyle.h"
2018-11-06 18:07:24 -05:00
# include "PropertyCustomizationHelpers.h"
# include "ScopedTransaction.h"
# include "IPropertyRowGenerator.h"
# include "Widgets/Views/STreeView.h"
# include "IDetailTreeNode.h"
# include "AssetThumbnail.h"
# include "MaterialEditorInstanceDetailCustomization.h"
# include "MaterialPropertyHelpers.h"
# include "DetailWidgetRow.h"
# include "Widgets/Input/SCheckBox.h"
# include "EditorSupportDelegates.h"
# include "Widgets/Images/SImage.h"
# include "MaterialEditor/MaterialEditorPreviewParameters.h"
# include "Widgets/Input/SButton.h"
# include "Widgets/Text/SInlineEditableTextBlock.h"
2022-12-12 13:40:46 -05:00
# include "Materials/MaterialFunction.h"
2018-11-06 18:07:24 -05:00
# include "Materials/MaterialFunctionInstance.h"
2022-12-12 13:40:46 -05:00
# include "Materials/MaterialFunctionInterface.h"
# include "Materials/MaterialExpressionTextureSampleParameter.h"
2018-11-06 18:07:24 -05:00
# include "Framework/Application/SlateApplication.h"
2019-09-10 11:35:20 -04:00
2018-11-06 18:07:24 -05:00
# include "Widgets/Input/SEditableTextBox.h"
# include "Curves/CurveLinearColor.h"
# include "Curves/CurveLinearColorAtlas.h"
# include "Widgets/Views/SExpanderArrow.h"
# include "Widgets/Layout/SWidgetSwitcher.h"
2019-10-01 20:41:42 -04:00
# include "MaterialEditor/DEditorRuntimeVirtualTextureParameterValue.h"
2022-10-16 02:28:34 -04:00
# include "MaterialEditor/DEditorSparseVolumeTextureParameterValue.h"
2021-01-26 17:21:08 -04:00
# include "ThumbnailRendering/ThumbnailManager.h"
2021-02-16 15:32:34 -04:00
# include "Styling/StyleColors.h"
2019-10-01 20:41:42 -04:00
2018-11-06 18:07:24 -05:00
# define LOCTEXT_NAMESPACE "MaterialLayerCustomization"
FString SMaterialParametersOverviewTreeItem : : GetCurvePath ( UDEditorScalarParameterValue * Parameter ) const
{
FString Path = Parameter - > AtlasData . Curve - > GetPathName ( ) ;
return Path ;
}
const FSlateBrush * SMaterialParametersOverviewTreeItem : : GetBorderImage ( ) const
{
2021-02-16 15:32:34 -04:00
return FAppStyle : : Get ( ) . GetBrush ( " DetailsView.CategoryMiddle " ) ;
}
FSlateColor SMaterialParametersOverviewTreeItem : : GetOuterBackgroundColor ( TSharedPtr < FSortedParamData > InParamData ) const
{
if ( IsHovered ( ) | | InParamData - > StackDataType = = EStackDataType : : Group )
2018-11-06 18:07:24 -05:00
{
2021-02-16 15:32:34 -04:00
return FAppStyle : : Get ( ) . GetSlateColor ( " Colors.Header " ) ;
2018-11-06 18:07:24 -05:00
}
2021-02-16 15:32:34 -04:00
return FAppStyle : : Get ( ) . GetSlateColor ( " Colors.Panel " ) ;
2018-11-06 18:07:24 -05:00
}
void SMaterialParametersOverviewTreeItem : : RefreshOnRowChange ( const FAssetData & AssetData , TSharedPtr < SMaterialParametersOverviewTree > InTree )
{
if ( InTree . IsValid ( ) )
{
2020-03-19 11:03:59 -04:00
InTree - > CreateGroupsWidget ( ) ;
2018-11-06 18:07:24 -05:00
}
}
void SMaterialParametersOverviewTreeItem : : Construct ( const FArguments & InArgs , const TSharedRef < STableViewBase > & InOwnerTableView )
{
StackParameterData = InArgs . _StackParameterData ;
MaterialEditorInstance = InArgs . _MaterialEditorInstance ;
Tree = InArgs . _InTree ;
TSharedRef < SWidget > LeftSideWidget = SNullWidget : : NullWidget ;
TSharedRef < SWidget > RightSideWidget = SNullWidget : : NullWidget ;
FText NameOverride ;
TSharedRef < SVerticalBox > WrapperWidget = SNew ( SVerticalBox ) ;
// GROUP --------------------------------------------------
if ( StackParameterData - > StackDataType = = EStackDataType : : Group )
{
NameOverride = FText : : FromName ( StackParameterData - > Group . GroupName ) ;
LeftSideWidget = SNew ( STextBlock )
2021-02-16 15:32:34 -04:00
. TransformPolicy ( ETextTransformPolicy : : ToUpper )
2018-11-06 18:07:24 -05:00
. Text ( NameOverride )
2021-02-16 15:32:34 -04:00
. Font ( FAppStyle : : Get ( ) . GetFontStyle ( " PropertyWindow.BoldFont " ) )
. TextStyle ( FAppStyle : : Get ( ) , " DetailsView.CategoryTextStyle " ) ;
2018-11-06 18:07:24 -05:00
}
// END GROUP
// PROPERTY ----------------------------------------------
2020-09-01 14:07:48 -04:00
bool bisPaddedProperty = false ;
2018-11-06 18:07:24 -05:00
if ( StackParameterData - > StackDataType = = EStackDataType : : Property )
{
UDEditorStaticComponentMaskParameterValue * CompMaskParam = Cast < UDEditorStaticComponentMaskParameterValue > ( StackParameterData - > Parameter ) ;
UDEditorVectorParameterValue * VectorParam = Cast < UDEditorVectorParameterValue > ( StackParameterData - > Parameter ) ;
UDEditorScalarParameterValue * ScalarParam = Cast < UDEditorScalarParameterValue > ( StackParameterData - > Parameter ) ;
2019-09-10 11:35:20 -04:00
UDEditorTextureParameterValue * TextureParam = Cast < UDEditorTextureParameterValue > ( StackParameterData - > Parameter ) ;
2018-11-06 18:07:24 -05:00
TAttribute < bool > IsParamEnabled = TAttribute < bool > : : Create ( TAttribute < bool > : : FGetter : : CreateStatic ( & FMaterialPropertyHelpers : : IsOverriddenExpression , StackParameterData - > Parameter ) ) ;
NameOverride = FText : : FromName ( StackParameterData - > Parameter - > ParameterInfo . Name ) ;
IDetailTreeNode & Node = * StackParameterData - > ParameterNode ;
TSharedPtr < IDetailPropertyRow > GeneratedRow = StaticCastSharedPtr < IDetailPropertyRow > ( Node . GetRow ( ) ) ;
IDetailPropertyRow & Row = * GeneratedRow . Get ( ) ;
Row . DisplayName ( NameOverride ) ;
if ( VectorParam & & VectorParam - > bIsUsedAsChannelMask )
{
FOnGetPropertyComboBoxStrings GetMaskStrings = FOnGetPropertyComboBoxStrings : : CreateStatic ( & FMaterialPropertyHelpers : : GetVectorChannelMaskComboBoxStrings ) ;
FOnGetPropertyComboBoxValue GetMaskValue = FOnGetPropertyComboBoxValue : : CreateStatic ( & FMaterialPropertyHelpers : : GetVectorChannelMaskValue , StackParameterData - > Parameter ) ;
FOnPropertyComboBoxValueSelected SetMaskValue = FOnPropertyComboBoxValueSelected : : CreateStatic ( & FMaterialPropertyHelpers : : SetVectorChannelMaskValue , StackParameterData - > ParameterNode - > CreatePropertyHandle ( ) , StackParameterData - > Parameter , ( UObject * ) MaterialEditorInstance ) ;
FDetailWidgetRow & CustomWidget = Row . CustomWidget ( ) ;
CustomWidget
. FilterString ( NameOverride )
. NameContent ( )
[
SNew ( STextBlock )
. Text ( NameOverride )
. ToolTipText ( FMaterialPropertyHelpers : : GetParameterExpressionDescription ( StackParameterData - > Parameter , MaterialEditorInstance ) )
2022-05-09 13:12:28 -04:00
. Font ( FAppStyle : : GetFontStyle ( TEXT ( " PropertyWindow.NormalFont " ) ) )
2018-11-06 18:07:24 -05:00
]
. ValueContent ( )
. MaxDesiredWidth ( 200.0f )
[
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. FillWidth ( 1.0f )
[
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. HAlign ( HAlign_Left )
. AutoWidth ( )
[
PropertyCustomizationHelpers : : MakePropertyComboBox ( StackParameterData - > ParameterNode - > CreatePropertyHandle ( ) , GetMaskStrings , GetMaskValue , SetMaskValue )
]
]
] ;
}
else if ( ScalarParam & & ScalarParam - > AtlasData . bIsUsedAsAtlasPosition )
{
const FText ParameterName = FText : : FromName ( StackParameterData - > Parameter - > ParameterInfo . Name ) ;
FDetailWidgetRow & CustomWidget = Row . CustomWidget ( ) ;
CustomWidget
. FilterString ( ParameterName )
. NameContent ( )
[
SNew ( STextBlock )
. Text ( ParameterName )
. ToolTipText ( FMaterialPropertyHelpers : : GetParameterExpressionDescription ( StackParameterData - > Parameter , MaterialEditorInstance ) )
2022-05-09 13:12:28 -04:00
. Font ( FAppStyle : : GetFontStyle ( TEXT ( " PropertyWindow.NormalFont " ) ) )
2018-11-06 18:07:24 -05:00
]
. ValueContent ( )
. HAlign ( HAlign_Fill )
. MaxDesiredWidth ( 400.0f )
[
SNew ( SObjectPropertyEntryBox )
. ObjectPath ( this , & SMaterialParametersOverviewTreeItem : : GetCurvePath , ScalarParam )
. AllowedClass ( UCurveLinearColor : : StaticClass ( ) )
. NewAssetFactories ( TArray < UFactory * > ( ) )
. DisplayThumbnail ( true )
. ThumbnailPool ( Tree . Pin ( ) - > GetTreeThumbnailPool ( ) )
2019-09-12 02:26:38 -04:00
. OnShouldFilterAsset ( FOnShouldFilterAsset : : CreateStatic ( & FMaterialPropertyHelpers : : OnShouldFilterCurveAsset , ScalarParam - > AtlasData . Atlas ) )
2018-11-06 18:07:24 -05:00
. OnShouldSetAsset ( FOnShouldSetAsset : : CreateStatic ( & FMaterialPropertyHelpers : : OnShouldSetCurveAsset , ScalarParam - > AtlasData . Atlas ) )
. OnObjectChanged ( FOnSetObject : : CreateStatic ( & FMaterialPropertyHelpers : : SetPositionFromCurveAsset , ScalarParam - > AtlasData . Atlas , ScalarParam , StackParameterData - > ParameterHandle , ( UObject * ) MaterialEditorInstance ) )
. DisplayCompactSize ( true )
] ;
}
2019-09-10 11:35:20 -04:00
else if ( TextureParam )
{
2019-10-01 20:41:42 -04:00
UMaterial * Material = MaterialEditorInstance - > PreviewMaterial ;
if ( Material ! = nullptr )
2019-09-10 11:35:20 -04:00
{
2019-10-01 20:41:42 -04:00
UMaterialExpressionTextureSampleParameter * Expression = Material - > FindExpressionByGUID < UMaterialExpressionTextureSampleParameter > ( TextureParam - > ExpressionId ) ;
if ( Expression ! = nullptr )
{
TWeakObjectPtr < UMaterialExpressionTextureSampleParameter > SamplerExpression = Expression ;
TSharedPtr < SWidget > NameWidget ;
TSharedPtr < SWidget > ValueWidget ;
FDetailWidgetRow DefaultRow ;
Row . GetDefaultWidgets ( NameWidget , ValueWidget , DefaultRow ) ;
FDetailWidgetRow & DetailWidgetRow = Row . CustomWidget ( ) ;
TSharedPtr < SVerticalBox > NameVerticalBox ;
DetailWidgetRow . NameContent ( )
2019-09-10 11:35:20 -04:00
[
2019-10-01 20:41:42 -04:00
SAssignNew ( NameVerticalBox , SVerticalBox )
+ SVerticalBox : : Slot ( )
. AutoHeight ( )
[
SNew ( STextBlock )
. Text ( FText : : FromName ( StackParameterData - > Parameter - > ParameterInfo . Name ) )
2022-05-09 13:12:28 -04:00
. Font ( FAppStyle : : GetFontStyle ( TEXT ( " PropertyWindow.NormalFont " ) ) )
2019-10-01 20:41:42 -04:00
]
] ;
DetailWidgetRow . ValueContent ( )
. MinDesiredWidth ( DefaultRow . ValueWidget . MinWidth )
. MaxDesiredWidth ( DefaultRow . ValueWidget . MaxWidth )
[
SNew ( SObjectPropertyEntryBox )
. PropertyHandle ( StackParameterData - > ParameterNode - > CreatePropertyHandle ( ) )
. AllowedClass ( UTexture : : StaticClass ( ) )
. ThumbnailPool ( Tree . Pin ( ) - > GetTreeThumbnailPool ( ) )
. OnShouldFilterAsset_Lambda ( [ SamplerExpression ] ( const FAssetData & AssetData )
{
if ( SamplerExpression . Get ( ) )
{
bool VirtualTextured = false ;
AssetData . GetTagValue < bool > ( " VirtualTextureStreaming " , VirtualTextured ) ;
bool ExpressionIsVirtualTextured = IsVirtualSamplerType ( SamplerExpression - > SamplerType ) ;
return VirtualTextured ! = ExpressionIsVirtualTextured ;
}
else
{
return false ;
}
} )
] ;
static const FName Red ( " R " ) ;
static const FName Green ( " G " ) ;
static const FName Blue ( " B " ) ;
static const FName Alpha ( " A " ) ;
if ( ! TextureParam - > ChannelNames . R . IsEmpty ( ) )
{
NameVerticalBox - > AddSlot ( )
[
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
2021-02-16 15:32:34 -04:00
. AutoWidth ( )
. Padding ( 20.0 , 2.0 , 4.0 , 2.0 )
[
SNew ( STextBlock )
. Text ( FText : : FromName ( Red ) )
2022-05-09 13:12:28 -04:00
. Font ( FAppStyle : : GetFontStyle ( TEXT ( " PropertyWindow.BoldFont " ) ) )
2021-02-16 15:32:34 -04:00
]
+ SHorizontalBox : : Slot ( )
. HAlign ( HAlign_Left )
. Padding ( 4.0 , 2.0 )
[
SNew ( STextBlock )
. Text ( TextureParam - > ChannelNames . R )
2022-05-09 13:12:28 -04:00
. Font ( FAppStyle : : GetFontStyle ( TEXT ( " PropertyWindow.NormalFont " ) ) )
2021-02-16 15:32:34 -04:00
]
2019-10-01 20:41:42 -04:00
] ;
}
if ( ! TextureParam - > ChannelNames . G . IsEmpty ( ) )
{
NameVerticalBox - > AddSlot ( )
[
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. Padding ( 20.0 , 2.0 , 4.0 , 2.0 )
. AutoWidth ( )
[
SNew ( STextBlock )
. Text ( FText : : FromName ( Green ) )
2022-05-09 13:12:28 -04:00
. Font ( FAppStyle : : GetFontStyle ( TEXT ( " PropertyWindow.BoldFont " ) ) )
2019-10-01 20:41:42 -04:00
]
+ SHorizontalBox : : Slot ( )
. HAlign ( HAlign_Left )
. Padding ( 4.0 , 2.0 )
[
SNew ( STextBlock )
. Text ( TextureParam - > ChannelNames . G )
2022-05-09 13:12:28 -04:00
. Font ( FAppStyle : : GetFontStyle ( TEXT ( " PropertyWindow.NormalFont " ) ) )
2019-10-01 20:41:42 -04:00
]
] ;
}
if ( ! TextureParam - > ChannelNames . B . IsEmpty ( ) )
{
NameVerticalBox - > AddSlot ( )
[
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. Padding ( 20.0 , 2.0 , 4.0 , 2.0 )
. AutoWidth ( )
[
SNew ( STextBlock )
. Text ( FText : : FromName ( Blue ) )
2022-05-09 13:12:28 -04:00
. Font ( FAppStyle : : GetFontStyle ( TEXT ( " PropertyWindow.BoldFont " ) ) )
2019-10-01 20:41:42 -04:00
]
+ SHorizontalBox : : Slot ( )
. HAlign ( HAlign_Left )
. Padding ( 4.0 , 2.0 )
[
SNew ( STextBlock )
. Text ( TextureParam - > ChannelNames . B )
2022-05-09 13:12:28 -04:00
. Font ( FAppStyle : : GetFontStyle ( TEXT ( " PropertyWindow.NormalFont " ) ) )
2019-10-01 20:41:42 -04:00
]
] ;
}
if ( ! TextureParam - > ChannelNames . A . IsEmpty ( ) )
{
NameVerticalBox - > AddSlot ( )
[
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. Padding ( 20.0 , 2.0 , 4.0 , 2.0 )
. AutoWidth ( )
[
SNew ( STextBlock )
. Text ( FText : : FromName ( Alpha ) )
2022-05-09 13:12:28 -04:00
. Font ( FAppStyle : : GetFontStyle ( TEXT ( " PropertyWindow.BoldFont " ) ) )
2019-10-01 20:41:42 -04:00
]
+ SHorizontalBox : : Slot ( )
. HAlign ( HAlign_Left )
. Padding ( 4.0 , 2.0 )
[
SNew ( STextBlock )
. Text ( TextureParam - > ChannelNames . A )
2022-05-09 13:12:28 -04:00
. Font ( FAppStyle : : GetFontStyle ( TEXT ( " PropertyWindow.NormalFont " ) ) )
2019-10-01 20:41:42 -04:00
]
] ;
}
}
2019-09-10 11:35:20 -04:00
}
}
2020-09-01 14:07:48 -04:00
else if ( CompMaskParam )
2018-11-06 18:07:24 -05:00
{
TSharedPtr < IPropertyHandle > RMaskProperty = StackParameterData - > ParameterNode - > CreatePropertyHandle ( ) - > GetChildHandle ( " R " ) ;
TSharedPtr < IPropertyHandle > GMaskProperty = StackParameterData - > ParameterNode - > CreatePropertyHandle ( ) - > GetChildHandle ( " G " ) ;
TSharedPtr < IPropertyHandle > BMaskProperty = StackParameterData - > ParameterNode - > CreatePropertyHandle ( ) - > GetChildHandle ( " B " ) ;
TSharedPtr < IPropertyHandle > AMaskProperty = StackParameterData - > ParameterNode - > CreatePropertyHandle ( ) - > GetChildHandle ( " A " ) ;
FDetailWidgetRow & CustomWidget = Row . CustomWidget ( ) ;
CustomWidget
. FilterString ( NameOverride )
. NameContent ( )
[
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. VAlign ( VAlign_Center )
[
SNew ( STextBlock )
. Text ( NameOverride )
. ToolTipText ( FMaterialPropertyHelpers : : GetParameterExpressionDescription ( StackParameterData - > Parameter , MaterialEditorInstance ) )
2022-05-09 13:12:28 -04:00
. Font ( FAppStyle : : GetFontStyle ( TEXT ( " PropertyWindow.NormalFont " ) ) )
2018-11-06 18:07:24 -05:00
]
]
. ValueContent ( )
. MaxDesiredWidth ( 200.0f )
[
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. FillWidth ( 1.0f )
[
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. HAlign ( HAlign_Left )
. AutoWidth ( )
[
2021-11-30 06:04:48 -05:00
RMaskProperty - > CreatePropertyNameWidget ( )
2018-11-06 18:07:24 -05:00
]
+ SHorizontalBox : : Slot ( )
. HAlign ( HAlign_Left )
. AutoWidth ( )
[
RMaskProperty - > CreatePropertyValueWidget ( )
]
+ SHorizontalBox : : Slot ( )
. HAlign ( HAlign_Left )
. Padding ( FMargin ( 10.0f , 0.0f , 0.0f , 0.0f ) )
. AutoWidth ( )
[
2021-11-30 06:04:48 -05:00
GMaskProperty - > CreatePropertyNameWidget ( )
2018-11-06 18:07:24 -05:00
]
+ SHorizontalBox : : Slot ( )
. HAlign ( HAlign_Left )
. AutoWidth ( )
[
GMaskProperty - > CreatePropertyValueWidget ( )
]
+ SHorizontalBox : : Slot ( )
. HAlign ( HAlign_Left )
. Padding ( FMargin ( 10.0f , 0.0f , 0.0f , 0.0f ) )
. AutoWidth ( )
[
2021-11-30 06:04:48 -05:00
BMaskProperty - > CreatePropertyNameWidget ( )
2018-11-06 18:07:24 -05:00
]
+ SHorizontalBox : : Slot ( )
. HAlign ( HAlign_Left )
. AutoWidth ( )
[
BMaskProperty - > CreatePropertyValueWidget ( )
]
+ SHorizontalBox : : Slot ( )
. HAlign ( HAlign_Left )
. Padding ( FMargin ( 10.0f , 0.0f , 0.0f , 0.0f ) )
. AutoWidth ( )
[
2021-11-30 06:04:48 -05:00
AMaskProperty - > CreatePropertyNameWidget ( )
2018-11-06 18:07:24 -05:00
]
+ SHorizontalBox : : Slot ( )
. HAlign ( HAlign_Left )
. AutoWidth ( )
[
AMaskProperty - > CreatePropertyValueWidget ( )
]
]
] ;
}
2020-09-01 14:07:48 -04:00
else
{
if ( TSharedPtr < IPropertyHandle > PropertyHandle = StackParameterData - > ParameterNode - > CreatePropertyHandle ( ) )
{
PropertyHandle - > MarkResetToDefaultCustomized ( true ) ;
}
FDetailWidgetDecl * CustomNameWidget = Row . CustomNameWidget ( ) ;
if ( CustomNameWidget )
{
( * CustomNameWidget )
[
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. VAlign ( VAlign_Center )
[
SNew ( STextBlock )
. Text ( NameOverride )
. ToolTipText ( FMaterialPropertyHelpers : : GetParameterExpressionDescription ( StackParameterData - > Parameter , MaterialEditorInstance ) )
2022-05-09 13:12:28 -04:00
. Font ( FAppStyle : : GetFontStyle ( TEXT ( " PropertyWindow.NormalFont " ) ) )
2020-09-01 14:07:48 -04:00
]
] ;
}
2021-02-03 14:57:28 -04:00
else
{
Row . ToolTip ( FMaterialPropertyHelpers : : GetParameterExpressionDescription ( StackParameterData - > Parameter , MaterialEditorInstance ) ) ;
}
2020-09-01 14:07:48 -04:00
bisPaddedProperty = true ;
}
2018-11-06 18:07:24 -05:00
FNodeWidgets NodeWidgets = Node . CreateNodeWidgets ( ) ;
LeftSideWidget = NodeWidgets . NameWidget . ToSharedRef ( ) ;
RightSideWidget = NodeWidgets . ValueWidget . ToSharedRef ( ) ;
}
// END PROPERTY
// PROPERTY CHILD ----------------------------------------
if ( StackParameterData - > StackDataType = = EStackDataType : : PropertyChild )
{
FNodeWidgets NodeWidgets = StackParameterData - > ParameterNode - > CreateNodeWidgets ( ) ;
LeftSideWidget = NodeWidgets . NameWidget . ToSharedRef ( ) ;
RightSideWidget = NodeWidgets . ValueWidget . ToSharedRef ( ) ;
}
// END PROPERTY CHILD
// FINAL WRAPPER
2020-09-23 08:16:20 -04:00
2018-11-06 18:07:24 -05:00
{
2020-09-23 08:16:20 -04:00
FDetailColumnSizeData & ColumnSizeData = InArgs . _InTree - > GetColumnSizeData ( ) ;
2020-09-01 14:07:48 -04:00
float ValuePadding = bisPaddedProperty ? 20.0f : 0.0f ;
2018-11-06 18:07:24 -05:00
WrapperWidget - > AddSlot ( )
. AutoHeight ( )
[
SNew ( SBorder )
2021-02-16 15:32:34 -04:00
. BorderImage ( FAppStyle : : Get ( ) . GetBrush ( " DetailsView.GridLine " ) )
. Padding ( FMargin ( 0 , 0 , 0 , 1 ) )
2018-11-06 18:07:24 -05:00
[
2021-02-16 15:32:34 -04:00
SNew ( SBorder )
. Padding ( 3.0f )
. BorderImage ( this , & SMaterialParametersOverviewTreeItem : : GetBorderImage )
. BorderBackgroundColor ( this , & SMaterialParametersOverviewTreeItem : : GetOuterBackgroundColor , StackParameterData )
2018-11-06 18:07:24 -05:00
[
2021-02-16 15:32:34 -04:00
SNew ( SSplitter )
2022-05-09 13:12:28 -04:00
. Style ( FAppStyle : : Get ( ) , " DetailsView.Splitter " )
2021-02-16 15:32:34 -04:00
. PhysicalSplitterHandleSize ( 1.0f )
. HitDetectionSplitterHandleSize ( 5.0f )
+ SSplitter : : Slot ( )
2021-11-02 09:22:12 -04:00
. Value ( ColumnSizeData . GetNameColumnWidth ( ) )
. OnSlotResized ( ColumnSizeData . GetOnNameColumnResized ( ) )
2021-02-16 15:32:34 -04:00
. Value ( 0.25f )
2018-11-06 18:07:24 -05:00
[
2021-02-16 15:32:34 -04:00
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. AutoWidth ( )
. VAlign ( VAlign_Center )
. Padding ( FMargin ( 3.0f ) )
[
SNew ( SExpanderArrow , SharedThis ( this ) )
]
+ SHorizontalBox : : Slot ( )
. Padding ( FMargin ( 2.0f ) )
. VAlign ( VAlign_Center )
[
LeftSideWidget
]
2018-11-06 18:07:24 -05:00
]
2021-02-16 15:32:34 -04:00
+ SSplitter : : Slot ( )
2021-11-02 09:22:12 -04:00
. Value ( ColumnSizeData . GetValueColumnWidth ( ) )
. OnSlotResized ( ColumnSizeData . GetOnValueColumnResized ( ) )
2018-11-06 18:07:24 -05:00
[
2021-02-16 15:32:34 -04:00
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. Padding ( FMargin ( 5.0f , 2.0f , 5.0 , 2.0f ) )
. HAlign ( HAlign_Left )
. VAlign ( VAlign_Center )
[
RightSideWidget
]
2018-11-06 18:07:24 -05:00
]
]
]
] ;
}
this - > ChildSlot
[
WrapperWidget
] ;
STableRow < TSharedPtr < FSortedParamData > > : : ConstructInternal (
STableRow : : FArguments ( )
2022-05-09 13:12:28 -04:00
. Style ( FAppStyle : : Get ( ) , " DetailsView.TreeView.TableRow " )
2018-11-06 18:07:24 -05:00
. ShowSelection ( false ) ,
InOwnerTableView
) ;
}
void SMaterialParametersOverviewTree : : Construct ( const FArguments & InArgs )
{
bHasAnyParameters = false ;
MaterialEditorInstance = InArgs . _InMaterialEditorInstance ;
Owner = InArgs . _InOwner ;
2020-03-19 11:03:59 -04:00
CreateGroupsWidget ( ) ;
2018-11-06 18:07:24 -05:00
STreeView < TSharedPtr < FSortedParamData > > : : Construct (
STreeView : : FArguments ( )
. TreeItemsSource ( & SortedParameters )
. SelectionMode ( ESelectionMode : : None )
. OnGenerateRow ( this , & SMaterialParametersOverviewTree : : OnGenerateRowMaterialLayersFunctionsTreeView )
. OnGetChildren ( this , & SMaterialParametersOverviewTree : : OnGetChildrenMaterialLayersFunctionsTreeView )
. OnExpansionChanged ( this , & SMaterialParametersOverviewTree : : OnExpansionChanged )
2019-06-04 15:42:48 -04:00
. ExternalScrollbar ( InArgs . _InScrollbar )
2018-11-06 18:07:24 -05:00
) ;
}
TSharedRef < ITableRow > SMaterialParametersOverviewTree : : OnGenerateRowMaterialLayersFunctionsTreeView ( TSharedPtr < FSortedParamData > Item , const TSharedRef < STableViewBase > & OwnerTable )
{
TSharedRef < SMaterialParametersOverviewTreeItem > ReturnRow = SNew ( SMaterialParametersOverviewTreeItem , OwnerTable )
. StackParameterData ( Item )
. MaterialEditorInstance ( MaterialEditorInstance )
. InTree ( SharedThis ( this ) ) ;
return ReturnRow ;
}
void SMaterialParametersOverviewTree : : OnGetChildrenMaterialLayersFunctionsTreeView ( TSharedPtr < FSortedParamData > InParent , TArray < TSharedPtr < FSortedParamData > > & OutChildren )
{
OutChildren = InParent - > Children ;
}
void SMaterialParametersOverviewTree : : OnExpansionChanged ( TSharedPtr < FSortedParamData > Item , bool bIsExpanded )
{
bool * ExpansionValue = MaterialEditorInstance - > OriginalMaterial - > ParameterOverviewExpansion . Find ( Item - > NodeKey ) ;
if ( ExpansionValue = = nullptr )
{
MaterialEditorInstance - > OriginalMaterial - > ParameterOverviewExpansion . Add ( Item - > NodeKey , bIsExpanded ) ;
}
else if ( * ExpansionValue ! = bIsExpanded )
{
MaterialEditorInstance - > OriginalMaterial - > ParameterOverviewExpansion . Emplace ( Item - > NodeKey , bIsExpanded ) ;
}
// Expand any children that are also expanded
for ( auto Child : Item - > Children )
{
bool * ChildExpansionValue = MaterialEditorInstance - > OriginalMaterial - > ParameterOverviewExpansion . Find ( Child - > NodeKey ) ;
if ( ChildExpansionValue ! = nullptr & & * ChildExpansionValue = = true )
{
SetItemExpansion ( Child , true ) ;
}
}
}
void SMaterialParametersOverviewTree : : SetParentsExpansionState ( )
{
for ( const auto & Pair : SortedParameters )
{
if ( Pair - > Children . Num ( ) )
{
bool * bIsExpanded = MaterialEditorInstance - > OriginalMaterial - > ParameterOverviewExpansion . Find ( Pair - > NodeKey ) ;
if ( bIsExpanded )
{
SetItemExpansion ( Pair , * bIsExpanded ) ;
}
else
{
SetItemExpansion ( Pair , true ) ;
}
}
}
}
TSharedPtr < class FAssetThumbnailPool > SMaterialParametersOverviewTree : : GetTreeThumbnailPool ( )
{
2021-01-26 17:21:08 -04:00
return UThumbnailManager : : Get ( ) . GetSharedThumbnailPool ( ) ;
2018-11-06 18:07:24 -05:00
}
2020-03-19 11:03:59 -04:00
void SMaterialParametersOverviewTree : : CreateGroupsWidget ( )
2018-11-06 18:07:24 -05:00
{
check ( MaterialEditorInstance ) ;
2021-03-05 19:27:14 -04:00
UnsortedParameters . Reset ( ) ;
SortedParameters . Reset ( ) ;
2018-11-06 18:07:24 -05:00
2020-03-05 12:23:03 -05:00
const TArray < TSharedRef < IDetailTreeNode > > TestData = GetOwner ( ) . Pin ( ) - > GetGenerator ( ) - > GetRootTreeNodes ( ) ;
if ( TestData . Num ( ) = = 0 )
2018-11-06 18:07:24 -05:00
{
2020-03-05 12:23:03 -05:00
return ;
2018-11-06 18:07:24 -05:00
}
TSharedPtr < IDetailTreeNode > Category = TestData [ 0 ] ;
TSharedPtr < IDetailTreeNode > ParameterGroups ;
TArray < TSharedRef < IDetailTreeNode > > Children ;
Category - > GetChildren ( Children ) ;
for ( int32 ChildIdx = 0 ; ChildIdx < Children . Num ( ) ; ChildIdx + + )
{
2021-05-12 18:10:03 -04:00
TSharedPtr < IPropertyHandle > PropertyHandle = Children [ ChildIdx ] - > CreatePropertyHandle ( ) ;
if ( PropertyHandle . IsValid ( ) & & PropertyHandle - > GetProperty ( ) & & PropertyHandle - > GetProperty ( ) - > GetName ( ) = = " ParameterGroups " )
2018-11-06 18:07:24 -05:00
{
ParameterGroups = Children [ ChildIdx ] ;
break ;
}
}
Children . Empty ( ) ;
2020-03-03 08:56:39 -05:00
// the order should correspond to UnsortedParameters exactly
TArray < TSharedPtr < IPropertyHandle > > DeferredSearches ;
2021-05-12 18:10:03 -04:00
if ( ParameterGroups . IsValid ( ) )
2018-11-06 18:07:24 -05:00
{
2021-05-12 18:10:03 -04:00
ParameterGroups - > GetChildren ( Children ) ;
for ( int32 GroupIdx = 0 ; GroupIdx < Children . Num ( ) ; + + GroupIdx )
2018-11-06 18:07:24 -05:00
{
2021-05-12 18:10:03 -04:00
TArray < void * > GroupPtrs ;
TSharedPtr < IPropertyHandle > ChildHandle = Children [ GroupIdx ] - > CreatePropertyHandle ( ) ;
ChildHandle - > AccessRawData ( GroupPtrs ) ;
auto GroupIt = GroupPtrs . CreateConstIterator ( ) ;
const FEditorParameterGroup * ParameterGroupPtr = reinterpret_cast < FEditorParameterGroup * > ( * GroupIt ) ;
if ( ! ParameterGroupPtr )
2018-11-06 18:07:24 -05:00
{
2021-05-12 18:10:03 -04:00
continue ;
}
2020-03-13 15:39:57 -04:00
2021-05-12 18:10:03 -04:00
const FEditorParameterGroup & ParameterGroup = * ParameterGroupPtr ;
if ( ParameterGroup . GroupName = = FMaterialPropertyHelpers : : LayerParamName )
{
// Don't create or show the material layer parameter info in this UI
continue ;
}
2020-03-13 15:39:57 -04:00
2021-05-12 18:10:03 -04:00
for ( int32 ParamIdx = 0 ; ParamIdx < ParameterGroup . Parameters . Num ( ) ; ParamIdx + + )
{
UDEditorParameterValue * Parameter = ParameterGroup . Parameters [ ParamIdx ] ;
if ( Parameter - > ParameterInfo . Association = = EMaterialParameterAssociation : : GlobalParameter )
2019-09-10 11:35:20 -04:00
{
2021-05-12 18:10:03 -04:00
bHasAnyParameters = true ;
TSharedPtr < IPropertyHandle > ParametersArrayProperty = ChildHandle - > GetChildHandle ( " Parameters " ) ;
TSharedPtr < IPropertyHandle > ParameterProperty = ParametersArrayProperty - > GetChildHandle ( ParamIdx ) ;
TSharedPtr < IPropertyHandle > ParameterValueProperty = ParameterProperty - > GetChildHandle ( " ParameterValue " ) ;
FUnsortedParamData NonLayerProperty ;
UDEditorScalarParameterValue * ScalarParam = Cast < UDEditorScalarParameterValue > ( Parameter ) ;
UDEditorVectorParameterValue * VectorParam = Cast < UDEditorVectorParameterValue > ( Parameter ) ;
if ( ScalarParam & & ScalarParam - > SliderMax > ScalarParam - > SliderMin )
{
ParameterValueProperty - > SetInstanceMetaData ( " UIMin " , FString : : Printf ( TEXT ( " %f " ) , ScalarParam - > SliderMin ) ) ;
ParameterValueProperty - > SetInstanceMetaData ( " UIMax " , FString : : Printf ( TEXT ( " %f " ) , ScalarParam - > SliderMax ) ) ;
}
if ( VectorParam )
{
static const FName Red ( " R " ) ;
static const FName Green ( " G " ) ;
static const FName Blue ( " B " ) ;
static const FName Alpha ( " A " ) ;
if ( ! VectorParam - > ChannelNames . R . IsEmpty ( ) )
{
ParameterProperty - > GetChildHandle ( Red ) - > SetPropertyDisplayName ( VectorParam - > ChannelNames . R ) ;
}
if ( ! VectorParam - > ChannelNames . G . IsEmpty ( ) )
{
ParameterProperty - > GetChildHandle ( Green ) - > SetPropertyDisplayName ( VectorParam - > ChannelNames . G ) ;
}
if ( ! VectorParam - > ChannelNames . B . IsEmpty ( ) )
{
ParameterProperty - > GetChildHandle ( Blue ) - > SetPropertyDisplayName ( VectorParam - > ChannelNames . B ) ;
}
if ( ! VectorParam - > ChannelNames . A . IsEmpty ( ) )
{
ParameterProperty - > GetChildHandle ( Alpha ) - > SetPropertyDisplayName ( VectorParam - > ChannelNames . A ) ;
}
}
NonLayerProperty . Parameter = Parameter ;
NonLayerProperty . ParameterGroup = ParameterGroup ;
NonLayerProperty . UnsortedName = Parameter - > ParameterInfo . Name ;
DeferredSearches . Add ( ParameterValueProperty ) ;
UnsortedParameters . Add ( NonLayerProperty ) ;
2020-03-05 16:39:36 -05:00
}
2018-11-06 18:07:24 -05:00
}
}
}
2020-03-03 08:56:39 -05:00
checkf ( UnsortedParameters . Num ( ) = = DeferredSearches . Num ( ) , TEXT ( " Internal inconsistency: number of node searches does not match the number of properties " ) ) ;
2020-03-05 13:23:18 -05:00
TArray < TSharedPtr < IDetailTreeNode > > DeferredResults = GetOwner ( ) . Pin ( ) - > GetGenerator ( ) - > FindTreeNodes ( DeferredSearches ) ;
2020-03-03 08:56:39 -05:00
checkf ( UnsortedParameters . Num ( ) = = DeferredResults . Num ( ) , TEXT ( " Internal inconsistency: number of node search results does not match the number of properties " ) ) ;
for ( int Idx = 0 , NumUnsorted = UnsortedParameters . Num ( ) ; Idx < NumUnsorted ; + + Idx )
{
FUnsortedParamData & NonLayerProperty = UnsortedParameters [ Idx ] ;
NonLayerProperty . ParameterNode = DeferredResults [ Idx ] ;
NonLayerProperty . ParameterHandle = NonLayerProperty . ParameterNode - > CreatePropertyHandle ( ) ;
}
2018-11-06 18:07:24 -05:00
ShowSubParameters ( ) ;
RequestTreeRefresh ( ) ;
SetParentsExpansionState ( ) ;
}
void SMaterialParametersOverviewTree : : ShowSubParameters ( )
{
for ( FUnsortedParamData Property : UnsortedParameters )
{
UDEditorParameterValue * Parameter = Property . Parameter ;
{
TSharedPtr < FSortedParamData > GroupProperty ( new FSortedParamData ( ) ) ;
GroupProperty - > StackDataType = EStackDataType : : Group ;
GroupProperty - > ParameterInfo . Index = Parameter - > ParameterInfo . Index ;
GroupProperty - > ParameterInfo . Association = Parameter - > ParameterInfo . Association ;
GroupProperty - > Group = Property . ParameterGroup ;
GroupProperty - > NodeKey = FString : : FromInt ( GroupProperty - > ParameterInfo . Index ) + FString : : FromInt ( GroupProperty - > ParameterInfo . Association ) + Property . ParameterGroup . GroupName . ToString ( ) ;
bool bAddNewGroup = true ;
for ( TSharedPtr < struct FSortedParamData > GroupChild : SortedParameters )
{
if ( GroupChild - > NodeKey = = GroupProperty - > NodeKey )
{
bAddNewGroup = false ;
}
}
if ( bAddNewGroup )
{
SortedParameters . Add ( GroupProperty ) ;
}
TSharedPtr < FSortedParamData > ChildProperty ( new FSortedParamData ( ) ) ;
ChildProperty - > StackDataType = EStackDataType : : Property ;
ChildProperty - > Parameter = Parameter ;
ChildProperty - > ParameterInfo . Index = Parameter - > ParameterInfo . Index ;
ChildProperty - > ParameterInfo . Association = Parameter - > ParameterInfo . Association ;
ChildProperty - > ParameterNode = Property . ParameterNode ;
ChildProperty - > PropertyName = Property . UnsortedName ;
ChildProperty - > NodeKey = FString : : FromInt ( ChildProperty - > ParameterInfo . Index ) + FString : : FromInt ( ChildProperty - > ParameterInfo . Association ) + Property . ParameterGroup . GroupName . ToString ( ) + Property . UnsortedName . ToString ( ) ;
UDEditorStaticComponentMaskParameterValue * CompMaskParam = Cast < UDEditorStaticComponentMaskParameterValue > ( Parameter ) ;
2019-10-01 20:41:42 -04:00
// No children for masks
2018-11-06 18:07:24 -05:00
if ( ! CompMaskParam )
{
TArray < TSharedRef < IDetailTreeNode > > ParamChildren ;
Property . ParameterNode - > GetChildren ( ParamChildren ) ;
for ( int32 ParamChildIdx = 0 ; ParamChildIdx < ParamChildren . Num ( ) ; ParamChildIdx + + )
{
TSharedPtr < FSortedParamData > ParamChildProperty ( new FSortedParamData ( ) ) ;
ParamChildProperty - > StackDataType = EStackDataType : : PropertyChild ;
ParamChildProperty - > ParameterNode = ParamChildren [ ParamChildIdx ] ;
ParamChildProperty - > ParameterHandle = ParamChildProperty - > ParameterNode - > CreatePropertyHandle ( ) ;
ParamChildProperty - > ParameterInfo . Index = Parameter - > ParameterInfo . Index ;
ParamChildProperty - > ParameterInfo . Association = Parameter - > ParameterInfo . Association ;
ParamChildProperty - > Parameter = ChildProperty - > Parameter ;
ChildProperty - > Children . Add ( ParamChildProperty ) ;
}
}
2019-10-01 20:41:42 -04:00
UDEditorRuntimeVirtualTextureParameterValue * VTParameter = Cast < UDEditorRuntimeVirtualTextureParameterValue > ( Parameter ) ;
2022-10-16 02:28:34 -04:00
UDEditorSparseVolumeTextureParameterValue * SVTParameter = Cast < UDEditorSparseVolumeTextureParameterValue > ( Parameter ) ;
2022-12-05 11:09:59 -05:00
// Don't add child property to this group if parameter is of type 'Virtual Texture' or 'Sparse Volume Texture'
if ( ! VTParameter & & ! SVTParameter )
2022-10-16 02:28:34 -04:00
{
for ( TSharedPtr < struct FSortedParamData > GroupChild : SortedParameters )
{
if ( GroupChild - > Group . GroupName = = Property . ParameterGroup . GroupName
& & GroupChild - > ParameterInfo . Association = = ChildProperty - > ParameterInfo . Association
& & GroupChild - > ParameterInfo . Index = = ChildProperty - > ParameterInfo . Index )
{
GroupChild - > Children . Add ( ChildProperty ) ;
}
}
}
2018-11-06 18:07:24 -05:00
}
}
}
const FSlateBrush * SMaterialParametersOverviewPanel : : GetBackgroundImage ( ) const
{
2022-05-09 13:12:28 -04:00
return FAppStyle : : GetBrush ( " DetailsView.CategoryTop " ) ;
2018-11-06 18:07:24 -05:00
}
int32 SMaterialParametersOverviewPanel : : GetPanelIndex ( ) const
{
return NestedTree & & NestedTree - > HasAnyParameters ( ) ? 1 : 0 ;
}
2020-03-19 11:03:59 -04:00
void SMaterialParametersOverviewPanel : : Refresh ( )
2018-11-06 18:07:24 -05:00
{
TSharedPtr < SHorizontalBox > HeaderBox ;
2020-03-19 11:03:59 -04:00
NestedTree - > CreateGroupsWidget ( ) ;
2018-11-06 18:07:24 -05:00
FOnClicked OnChildButtonClicked = FOnClicked ( ) ;
if ( MaterialEditorInstance - > OriginalFunction )
{
OnChildButtonClicked = FOnClicked : : CreateStatic ( & FMaterialPropertyHelpers : : OnClickedSaveNewFunctionInstance , ImplicitConv < UMaterialFunctionInterface * > ( MaterialEditorInstance - > OriginalFunction ) , ImplicitConv < UMaterialInterface * > ( MaterialEditorInstance - > PreviewMaterial ) , ImplicitConv < UObject * > ( MaterialEditorInstance ) ) ;
}
else
{
OnChildButtonClicked = FOnClicked : : CreateStatic ( & FMaterialPropertyHelpers : : OnClickedSaveNewMaterialInstance , ImplicitConv < UMaterialInterface * > ( MaterialEditorInstance - > OriginalMaterial ) , ImplicitConv < UObject * > ( MaterialEditorInstance ) ) ;
}
2019-11-07 16:37:28 -05:00
if ( NestedTree - > HasAnyParameters ( ) )
2018-11-06 18:07:24 -05:00
{
this - > ChildSlot
2020-09-23 08:16:20 -04:00
[
SNew ( SVerticalBox )
+ SVerticalBox : : Slot ( )
2021-02-16 15:32:34 -04:00
. Padding ( 0.0f )
2019-11-07 16:37:28 -05:00
[
2021-02-16 15:32:34 -04:00
SNew ( SVerticalBox )
+ SVerticalBox : : Slot ( )
. AutoHeight ( )
2020-09-23 08:16:20 -04:00
[
2021-02-16 15:32:34 -04:00
SAssignNew ( HeaderBox , SHorizontalBox )
2020-09-23 08:16:20 -04:00
]
2021-02-16 15:32:34 -04:00
+ SVerticalBox : : Slot ( )
. Padding ( 0.0f )
[
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. HAlign ( HAlign_Fill )
[
NestedTree . ToSharedRef ( )
]
+ SHorizontalBox : : Slot ( )
. HAlign ( HAlign_Right )
. AutoWidth ( )
[
SNew ( SBox )
. WidthOverride ( 16.0f )
[
ExternalScrollbar . ToSharedRef ( )
]
]
]
2019-11-07 16:37:28 -05:00
]
2020-09-23 08:16:20 -04:00
] ;
2018-11-06 18:07:24 -05:00
HeaderBox - > AddSlot ( )
. FillWidth ( 1.0f )
[
SNullWidget : : NullWidget
] ;
2019-11-07 16:37:28 -05:00
2018-11-06 18:07:24 -05:00
if ( NestedTree - > HasAnyParameters ( ) )
{
HeaderBox - > AddSlot ( )
. AutoWidth ( )
. Padding ( 2.0f )
[
SNew ( SButton )
2021-02-16 15:32:34 -04:00
. Text ( LOCTEXT ( " SaveChild " , " Save Child " ) )
2020-09-23 08:16:20 -04:00
. HAlign ( HAlign_Center )
. OnClicked ( OnChildButtonClicked )
. ToolTipText ( LOCTEXT ( " SaveToChildInstance " , " Save To Child Instance " ) )
2018-11-06 18:07:24 -05:00
] ;
}
}
2019-11-07 16:37:28 -05:00
else
{
this - > ChildSlot
[
2021-02-16 15:32:34 -04:00
SNew ( SBox )
. Padding ( 10.0f )
. HAlign ( HAlign_Center )
2019-11-07 16:37:28 -05:00
[
SNew ( STextBlock )
2019-11-08 10:23:08 -05:00
. Text ( LOCTEXT ( " ConnectMaterialParametersToFillList " , " Connect a parameter to see it here. " ) )
2019-11-07 16:37:28 -05:00
]
] ;
}
2018-11-06 18:07:24 -05:00
}
void SMaterialParametersOverviewPanel : : Construct ( const FArguments & InArgs )
{
2019-06-04 15:42:48 -04:00
ExternalScrollbar = SNew ( SScrollBar ) ;
2020-03-05 12:23:03 -05:00
TSharedPtr < IPropertyRowGenerator > InGenerator = InArgs . _InGenerator ;
Generator = InGenerator ;
2019-06-04 15:42:48 -04:00
2018-11-06 18:07:24 -05:00
NestedTree = SNew ( SMaterialParametersOverviewTree )
. InMaterialEditorInstance ( InArgs . _InMaterialEditorInstance )
2019-06-04 15:42:48 -04:00
. InOwner ( SharedThis ( this ) )
. InScrollbar ( ExternalScrollbar ) ;
2018-11-06 18:07:24 -05:00
MaterialEditorInstance = InArgs . _InMaterialEditorInstance ;
2019-08-19 12:24:43 -04:00
Refresh ( ) ;
2018-11-06 18:07:24 -05:00
}
void SMaterialParametersOverviewPanel : : UpdateEditorInstance ( UMaterialEditorPreviewParameters * InMaterialEditorInstance )
{
NestedTree - > MaterialEditorInstance = InMaterialEditorInstance ;
Refresh ( ) ;
}
TSharedPtr < class IPropertyRowGenerator > SMaterialParametersOverviewPanel : : GetGenerator ( )
{
2020-03-05 12:23:03 -05:00
return Generator . Pin ( ) ;
2018-11-06 18:07:24 -05:00
}
2020-03-05 12:23:03 -05:00
# undef LOCTEXT_NAMESPACE