// Copyright Epic Games, Inc. All Rights Reserved. #if WITH_EDITOR #include "AudioDrivenAnimationCustomizations.h" #include "AudioDrivenAnimationConfig.h" #include "DetailWidgetRow.h" #include "IDetailChildrenBuilder.h" namespace UE::MetaHuman::Private { TSharedRef FAudioSolveOverridesPropertyTypeCustomization::MakeInstance() { return MakeShared(); } void FAudioSolveOverridesPropertyTypeCustomization::CustomizeHeader(TSharedRef StructPropertyHandle, FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils) { HeaderRow .NameContent()[StructPropertyHandle->CreatePropertyNameWidget()] .ValueContent()[StructPropertyHandle->CreatePropertyValueWidget()]; } void FAudioSolveOverridesPropertyTypeCustomization::CustomizeChildren(TSharedRef StructPropertyHandle, IDetailChildrenBuilder& StructBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils) { TSharedRef MoodPropertyHandle = StructPropertyHandle->GetChildHandle( GET_MEMBER_NAME_CHECKED(FAudioDrivenAnimationSolveOverrides, Mood) ).ToSharedRef(); StructBuilder.AddProperty(MoodPropertyHandle); TSharedRef MoodIntensityPropertyHandle = StructPropertyHandle->GetChildHandle( GET_MEMBER_NAME_CHECKED(FAudioDrivenAnimationSolveOverrides, MoodIntensity) ).ToSharedRef(); StructBuilder .AddProperty(MoodIntensityPropertyHandle) .IsEnabled( MakeAttributeLambda( [MoodPropertyHandle]() { uint8 MoodPropertyValue; const FPropertyAccess::Result Result = MoodPropertyHandle->GetValue(MoodPropertyValue); if (Result == FPropertyAccess::Success) { EAudioDrivenAnimationMood Mood = static_cast(MoodPropertyValue); // We disable the mood intensity property for the neutral mood, it has no meaning there. return Mood != EAudioDrivenAnimationMood::Neutral; } return false; } ) ); } } // namespace UE::MetaHuman::Private #endif // WITH_EDITOR