Hello!
In a sequence structure where there is a spawnable in a root sequence with an attach track and a subsequence containing a possessable bound to the spawnable with its own attach track, we’re finding that sometimes the attach track in the root is applied and other times the attach track in the sub sequence is applied.
(The reason we have structure our sequences like this is that we would like the spawnable actor to have a default attachment; however, some shot sequences may want to temporarily override that by adding an attach track of their own.)
In `FAttachmentHandler::UpdateOutput` the `Inputs` seem to be unsorted, but the first input is always the attachment that is applied. In the above configuration, sometimes the input created by the attach section in the root sequence will come first and other times the input created by the attach section in the sub sequence will come first meaning that we don’t know which attach section will take effect.
We’re evaluating making a change to that function to select the input with the largest hierarchical bias so that attach sections in sub sequences that are deeper in the hierarchy have precedence over those higher in the hierarchy. It would look something like this:
FMovieSceneEntityID Entity;
TOptional<int16> MaxHierarchicalBias;
for (FMovieSceneEntityID Input : Inputs)
{
TOptionalComponentReader<int16> HierarchicalBias = EntityManager->ReadComponent(Input, BuiltInComponents->HierarchicalBias);
if (!MaxHierarchicalBias.IsSet() || (HierarchicalBias && *HierarchicalBias > MaxHierarchicalBias.GetValue()))
{
MaxHierarchicalBias = HierarchicalBias ? *HierarchicalBias : 0;
Entity = Input;
}
}
if (Entity.IsValid())
{
// Apply attachment
}
I’m wondering if this is a change that Epic would consider adding to Unreal, or if there is an alternate approach we could use to give one attach section precedence over another? (I looked into `UMovieSceneSection::OverlapPriority` but it doesn’t seem to impact the order of the inputs).
Thanks,
Scott