Files
UnrealEngineUWP/Engine/Source/Runtime/LevelSequence/Private/LevelSequenceObject.cpp
Max Preussner 56dd4c8ad0 Sequencer: Renamed ActorAnimation to LevelSequence
This will break existing content. An upgrade path is not available, i.e. no redirectors.

#CodeReview: max.chen, frank.fella, andrew.rodham, matt.kuhlenschmidt

[CL 2709960 by Max Preussner in Main branch]
2015-09-29 15:15:21 -04:00

54 lines
1011 B
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "LevelSequencePCH.h"
#include "LevelSequenceObject.h"
/* FSequencerPossessedObject interface
*****************************************************************************/
UObject* FLevelSequenceObject::GetObject() const
{
// get component-less object
if (ComponentName.IsEmpty())
{
return ObjectOrOwner.Get();
}
// get cached component
if ((CachedComponent.IsValid()) && (CachedComponent->GetName() == ComponentName))
{
return CachedComponent.Get();
}
CachedComponent = nullptr;
// find & cache component
UObject* Object = ObjectOrOwner.Get();
if (Object == nullptr)
{
return nullptr;
}
AActor* Owner = Cast<AActor>(Object);
if (Owner == nullptr)
{
return Object;
}
for (UActorComponent* ActorComponent : Owner->GetComponents())
{
if (ActorComponent->GetName() == ComponentName)
{
CachedComponent = ActorComponent;
return ActorComponent;
}
}
// component not found
return nullptr;
}