Files
UnrealEngineUWP/Engine/Source/Editor/DetailCustomizations/Private/MeshComponentDetails.cpp
ryan durand 627baf970a Updating copyright for Engine Editor.
#rnx
#rb none


#ROBOMERGE-SOURCE: CL 10869241 via CL 10869527 via CL 10869904
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870586 by ryan durand in Main branch]
2019-12-26 15:33:43 -05:00

30 lines
1.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "MeshComponentDetails.h"
#include "Components/MeshComponent.h"
#include "PropertyHandle.h"
#include "DetailLayoutBuilder.h"
#include "DetailCategoryBuilder.h"
#include "IDetailsView.h"
#include "AssetSelection.h"
TSharedRef<IDetailCustomization> FMeshComponentDetails::MakeInstance()
{
return MakeShareable( new FMeshComponentDetails );
}
void FMeshComponentDetails::CustomizeDetails( IDetailLayoutBuilder& DetailLayout )
{
RenderingCategory = &DetailLayout.EditCategory("Rendering");
TSharedRef<IPropertyHandle> MaterialProperty = DetailLayout.GetProperty( GET_MEMBER_NAME_CHECKED(UMeshComponent, OverrideMaterials) );
if( MaterialProperty->IsValidHandle() )
{
// Only show this in the advanced section of the category if we have selected actors (which will show a separate material section)
bool bIsAdvanced = DetailLayout.GetDetailsView()->GetSelectedActorInfo().NumSelected > 0;
RenderingCategory->AddProperty( MaterialProperty, bIsAdvanced ? EPropertyLocation::Advanced : EPropertyLocation::Default );
}
}