Files
UnrealEngineUWP/Engine/Source/Editor/DetailCustomizations/Private/MeshComponentDetails.cpp
Ben Marsh 149375b14b Update copyright notices to 2015.
[CL 2379638 by Ben Marsh in Main branch]
2014-12-07 19:09:38 -05:00

25 lines
981 B
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "DetailCustomizationsPrivatePCH.h"
#include "MeshComponentDetails.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 );
}
}