https://www.unrealengine.com/en-US/tech-blog/performance-at-scale-sequencer-in-unreal-engine-4-26
https://zhuanlan.zhihu.com/p/544571505
https://zhuanlan.zhihu.com/p/589465561
https://zhuanlan.zhihu.com/p/413151867
‘https://zhuanlan.zhihu.com/p/676690043
Old :
New :
https://www.processon.com/view/610a43b8e401fd6714bda5b2
来源 : 知乎大佬
FadeTrackEditor.cpp
FadeTrackEditor.h
MovieSceneFadeSection.cpp
MovieSceneFadeSection.h
/**
* A single floating point section.
*/
UCLASS(MinimalAPI)
class UMovieSceneFadeSection
: public UMovieSceneSection
, public IMovieSceneEntityProvider
MovieSceneFadeTrack.cpp
MovieSceneFadeTrack.h
/**
* Implements a movie scene track that controls a fade.
*/
UCLASS(MinimalAPI)
class UMovieSceneFadeTrack
: public UMovieSceneFloatTrack
MovieSceneFadeSystem.cpp
MovieSceneFadeSystem.h
UCLASS()
class UMovieSceneFadeSystem : public UMovieSceneEntitySystem
// Core Impl
namespace UE::MovieScene
struct FFadeUtil
struct FPreAnimatedFadeState
struct FPreAnimatedFadeStateStorage : TSimplePreAnimatedStateStorage<FMovieSceneAnimTypeID, FPreAnimatedFadeState>
TAutoRegisterPreAnimatedStorageID<FPreAnimatedFadeStateStorage> FPreAnimatedFadeStateStorage::StorageID;
MovieSceneEntitySystemTask.h
为每个符合过滤器和组件类型的实体调度一个任务。必须使用要调度的任务类型显式实例化。构造参数会被推断。
任务必须实现与该任务的组件访问器类型匹配的 ForEachEntity 函数
/**
* Dispatch a task for every entity that matches the filters and component types. Must be explicitly instantiated with the task type to dispatch. Construction arguments are deduced.
* Tasks must implement a ForEachEntity function that matches this task's component accessor types.
*
* For example:
* struct FForEachEntity
* {
* void ForEachEntity(FMovieSceneEntityID InEntityID, const FMovieSceneFloatChannel& Channel);
* };
*
* TComponentTypeID<FMovieSceneFloatChannel> FloatChannelComponent = ...;
*
* FGraphEventRef Task = FEntityTaskBuilder()
* .ReadEntityIDs()
* .Read(FloatChannelComponent)
* .SetStat(GET_STATID(MyStatName))
* .SetDesiredThread(ENamedThreads::AnyThread)
* .Dispatch_PerEntity<FForEachEntity>(EntityManager, Prerequisites);
*
* @param EntityManager The entity manager to run the task on. All component types *must* relate to this entity manager.
* @param Prerequisites Prerequisite tasks that must run before this one, or nullptr if there are no prerequisites
* @param Subsequents (Optional) Subsequent task tracking that this task should be added to for each writable component type
* @param InArgs Optional arguments that are forwarded to the constructor of TaskImpl
* @return A pointer to the graph event for the task, or nullptr if this task is not valid (ie contains invalid component types that would be necessary for the task to run), or threading is disabled
*/
template<typename TaskImpl, typename... TaskConstructionArgs>
FGraphEventRef Dispatch_PerEntity(FEntityManager* EntityManager, const FSystemTaskPrerequisites& Prerequisites, FSystemSubsequentTasks* Subsequents, TaskConstructionArgs&&... InArgs) const
为每个符合过滤器和组件类型的分配分配一个任务。必须使用要分配的任务类型显式实例化。构造参数会被推断。
任务必须实现与该任务的组件访问器类型匹配的 ForEachAllocation 函数。
/**
* Dispatch a task for every allocation that matches the filters and component types. Must be explicitly instantiated with the task type to dispatch. Construction arguments are deduced.
* Tasks must implement a ForEachAllocation function that matches this task's component accessor types.
*
* For example:
* struct FForEachAllocation
* {
* void ForEachAllocation(FEntityAllocation* InAllocation, const TFilteredEntityTask< FEntityIDAccess, TRead<FMovieSceneFloatChannel> >& InputTask);
* };
*
* TComponentTypeID<FMovieSceneFloatChannel> FloatChannelComponent = ...;
*
* FGraphEventRef Task = FEntityTaskBuilder()
* .ReadEntityIDs()
* .Read(FloatChannelComponent)
* .SetStat(GET_STATID(MyStatName))
* .SetDesiredThread(ENamedThreads::AnyThread)
* .Dispatch_PerAllocation<FForEachAllocation>(EntityManager, Prerequisites);
*
* @param EntityManager The entity manager to run the task on. All component types *must* relate to this entity manager.
* @param Prerequisites Prerequisite tasks that must run before this one
* @param Subsequents (Optional) Subsequent task tracking that this task should be added to for each writable component type
* @param InArgs Optional arguments that are forwarded to the constructor of TaskImpl
* @return A pointer to the graph event for the task, or nullptr if this task is not valid (ie contains invalid component types that would be necessary for the task to run), or threading is disabled
*/
template<typename TaskImpl, typename... TaskConstructionArgs>
FGraphEventRef Dispatch_PerAllocation(FEntityManager* EntityManager, const FSystemTaskPrerequisites& Prerequisites, FSystemSubsequentTasks* Subsequents, TaskConstructionArgs&&... InArgs) const
Key Paths :
-
Engine/Runtime/MovieScene/
-
Engine/Runtime/MovieSceneTracks/
找对象
UCameraShakeSourceComponent* FCameraShakeSourceShakeTrackEditor::AcquireCameraShakeSourceComponentFromGuid(const FGuid& Guid)
{
TArray<UCameraShakeSourceComponent*> ShakeSourceComponents;
for (TWeakObjectPtr<> WeakObject : GetSequencer()->FindObjectsInCurrentSequence(Guid))
{
if (UObject* Obj = WeakObject.Get())
{
if (AActor* Actor = Cast<AActor>(Obj))
{
TArray<UCameraShakeSourceComponent*> CurShakeSourceComponents;
Actor->GetComponents(CurShakeSourceComponents);
ShakeSourceComponents.Append(CurShakeSourceComponents);
}
else if (UCameraShakeSourceComponent* ShakeSourceComponent = Cast<UCameraShakeSourceComponent>(Obj))
{
ShakeSourceComponents.Add(ShakeSourceComponent);
}
}
}
UCameraShakeSourceComponent** ActiveComponent = ShakeSourceComponents.FindByPredicate([](UCameraShakeSourceComponent* Component)
{
return Component->IsActive();
});
if (ActiveComponent != nullptr)
{
return *ActiveComponent;
}
if (ShakeSourceComponents.Num() > 0)
{
return ShakeSourceComponents[0];
}
return nullptr;
}
暂无评论内容