Navigation
API > API/Runtime > API/Runtime/MovieScene > API/Runtime/MovieScene/EntitySystem > API/Runtime/MovieScene/EntitySystem/UMovieSceneEntityGroupingSystem > API/Runtime/MovieScene/EntitySystem/UMovieSceneEntityGroupingSystem/AddGrouping
References
| Module | MovieScene |
| Header | /Engine/Source/Runtime/MovieScene/Public/EntitySystem/MovieSceneEntityGroupingSystem.h |
| Include | #include "EntitySystem/MovieSceneEntityGroupingSystem.h" |
template<typename GroupingPolicy, typename ... ComponentTypes>
FEntityGroupingPolicyKey AddGrouping
(
GroupingPolicy && InPolicy,
TComponentTypeID < ComponentTypes >... InComponents
)
Remarks
Add a new grouping policy that will use the given components to make up a group key.
Grouping policies must be simple structs that can be copied and owned by the grouping system, and that implement the following members:
- GroupKeyType [mandatory] A typedef or alias to the group key type to use to group entities together.
- GetGroupKey(ComponentTypes... InComponents, GroupKeyType& OutGroupKey) [mandatory] A function that creates a group key used to group entities together. Returns true to indicate the key is valid, false otherwise. If false, the entity corresponding to the given components will not be grouped.
- OnObjectsReplaced(GroupKeyType& InOut, const TMap
&) [mandatory, sadly] Potentially changes a key if it contains a pointer to a replaced object. Should return true if any replacement occured. - PreTask() [optional] A function called before any grouping is done during an instantiation phase.
- PostTask() [optional] A function called after any grouping is done dunring an instantiation phase.
- PreProcessGroups() [optional]
- PostProcessGroups() [optional]