Files
UnrealEngineUWP/Engine/Source/Runtime/ActorAnimation/Private/ActorAnimationObject.cpp
Max Preussner eb6a4af8dd MovieScene: Refactored MovieScene and Sequencer to unify the implementation and handling of movie scenes and object bindings
- IMovieSceneAnimation derivatives are now the primary types consumed by Sequencer; they hold a root MovieScene inside
- Object binding managers have been removed; bindings are persisted in UActorAnimation, UNiagaraAnimation, UWidgetAnimation
- MovieSceneAssetEditor is now ActorAnimationEditor and became a plug-in
- MovieSceneRuntimePlayer is now ActorAnimationPlayer; K2Node_PlayMovieScene has been removed

#CodeReview: matt.kuhlenschmidt, frank.fella, nick.darnell, olaf.piesche, max.chen, andrew.rodham

[CL 2628945 by Max Preussner in Main branch]
2015-07-22 10:59:40 -04:00

54 lines
1016 B
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "ActorAnimationPrivatePCH.h"
#include "ActorAnimationObject.h"
/* FSequencerPossessedObject interface
*****************************************************************************/
UObject* FActorAnimationObject::GetObject() const
{
// get component-less object
if (ComponentName.IsEmpty())
{
return ObjectOrOwner.Get();
}
// get cached component
if ((CachedComponent != nullptr) && (CachedComponent->GetName() == ComponentName))
{
return CachedComponent;
}
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;
}