Files
UnrealEngineUWP/Engine/Source/Editor/Sequencer/Private/KeyPropertyParams.cpp
Frank Fella 59dbef1cee Sequencer - Fix shadowed variable warnings.
[CL 2585004 by Frank Fella in Main branch]
2015-06-11 17:40:27 -04:00

58 lines
1.7 KiB
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "SequencerPrivatePCH.h"
#include "PropertyHandle.h"
void PropertyHandleToPropertyPath(const UClass* OwnerClass, const IPropertyHandle& InPropertyHandle, TArray<UProperty*>& PropertyPath)
{
PropertyPath.Add(InPropertyHandle.GetProperty());
TSharedPtr<IPropertyHandle> CurrentHandle = InPropertyHandle.GetParentHandle();
while (CurrentHandle.IsValid() && CurrentHandle->GetProperty() != nullptr)
{
PropertyPath.Insert(CurrentHandle->GetProperty(), 0);
CurrentHandle = CurrentHandle->GetParentHandle();
}
}
FCanKeyPropertyParams::FCanKeyPropertyParams()
{
ObjectClass = nullptr;
}
FCanKeyPropertyParams::FCanKeyPropertyParams(UClass* InObjectClass, TArray<UProperty*> InPropertyPath)
{
ObjectClass = InObjectClass;
PropertyPath = InPropertyPath;
}
FCanKeyPropertyParams::FCanKeyPropertyParams(UClass* InObjectClass, const IPropertyHandle& InPropertyHandle)
{
ObjectClass = InObjectClass;
PropertyHandleToPropertyPath(ObjectClass, InPropertyHandle, PropertyPath);
}
FKeyPropertyParams::FKeyPropertyParams()
{
}
FKeyPropertyParams::FKeyPropertyParams(TArray<UObject*> InObjectsToKey, TArray<UProperty*> InPropertyPath)
{
ObjectsToKey = InObjectsToKey;
PropertyPath = InPropertyPath;
}
FKeyPropertyParams::FKeyPropertyParams(TArray<UObject*> InObjectsToKey, const IPropertyHandle& InPropertyHandle)
{
ObjectsToKey = InObjectsToKey;
PropertyHandleToPropertyPath(InObjectsToKey[0]->GetClass(), InPropertyHandle, PropertyPath);
}
FString FPropertyChangedParams::GetPropertyPathString() const
{
TArray<FString> PropertyNames;
for (UProperty* Property : PropertyPath)
{
PropertyNames.Add(Property->GetName());
}
return FString::Join(PropertyNames, TEXT("."));
}