TFilteredEntityTask::Dispatch_PerEntity

Dispatch a task for every entity that matches the filters and component types.

Windows
MacOS
Linux

References

Module

MovieScene

Header

/Engine/Source/Runtime/MovieScene/Public/EntitySystem/MovieSceneEntitySystemTask.h

Include

#include "EntitySystem/MovieSceneEntitySystemTask.h"

Syntax

template<typename TaskImpl, typename... TaskConstructionArgs>
FGraphEventRef Dispatch_PerEntity
(
    FEntityManager * EntityManager,
    const FSystemTaskPrerequisites & Prerequisites,
    FSystemSubsequentTasks * Subsequents,
    TaskConstructionArgs &&... InArgs
) const

Remarks

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 FloatChannelComponent = ...;

FGraphEventRef Task = FEntityTaskBuilder() .ReadEntityIDs() .Read(FloatChannelComponent) .SetStat(GET_STATID(MyStatName)) .SetDesiredThread(ENamedThreads::AnyThread) .Dispatch_PerEntity(EntityManager, Prerequisites);

Returns

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

Parameters

Parameter

Description

EntityManager

The entity manager to run the task on. All component types must relate to this entity manager.

Prerequisites

Prerequisite tasks that must run before this one, or nullptr if there are no prerequisites

Subsequents

(Optional) Subsequent task tracking that this task should be added to for each writable component type

InArgs

Optional arguments that are forwarded to the constructor of TaskImpl

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss