// Copyright Epic Games, Inc. All Rights Reserved. #include "PropertyEditorCopyPaste.h" #include "PropertyEditorCopyPastePrivate.h" #include "PropertyHandleImpl.h" #include "PropertyNode.h" namespace UE::PropertyEditor { FString GetPropertyPath(const TSharedPtr& InPropertyHandle) { return Private::GetPropertyPath( [InPropertyHandle] { return InPropertyHandle; }, {}); } bool TagMatchesProperty(const FString& InTag, const TSharedPtr& InPropertyHandle) { if (InTag.IsEmpty()) { return true; } const FString PropertyPath = UE::PropertyEditor::GetPropertyPath(InPropertyHandle); // If tag is specified, ensure that it matches the property (by path) return InTag.Equals(PropertyPath); } namespace Private { FString GetPropertyPath( TUniqueFunction()>&& GetPropertyHandle, TUniqueFunction()>&& GetPropertyNode) { const TSharedPtr PropertyHandle = GetPropertyHandle(); if (PropertyHandle.IsValid() && PropertyHandle->IsValidHandle()) { FString PropertyPath = PropertyHandle->GeneratePathToProperty(); if (!PropertyPath.IsEmpty()) { return PropertyPath; } } TSharedPtr PropertyNode = nullptr; if (GetPropertyNode) { PropertyNode = GetPropertyNode(); } if (!PropertyNode && PropertyHandle.IsValid() && PropertyHandle->IsValidHandle()) { PropertyNode = StaticCastSharedPtr(PropertyHandle)->GetPropertyNode(); } const static FString EmptyString = TEXT(""); return PropertyNode.IsValid() ? PropertyNode->GetPropertyPath() : EmptyString; } } }