Description

In UTakeRecorderActorSource::EnsureObjectTemplateHasComponent() function, MakeUniqueObjectName() generates the same name of a component which CachedObjectTemplate for TakeRecorder has already had. This lead CachedObjectTemplate->AddInstanceComponent() fails because MakeUniqueObjectName(). As a result, some of Niagara FX spawning is not taken recorded in level sequencer.

More detail, when particle system is spawend for attachemnt, the core system calls MakeUniqueObjectName() to specify the unique name like NiagaraComponent_0, NiagaraComponent_1 and NiagaraComponent_2.

After that, the existence of this component is told to Take Recorder system and it tries to detect that a new component has been created. Then it calls MakeUniqueObjectName() and duplicate the component with the generated name. But this name generated by MakeUniqueObjectName() is not unique sometimes. This happens only once every two times.

To avoid this, we may repeat calling MakeUniqueObjectName until a true unique name is generated. Or just add some suffix string?

// Ensure the component name is unique within the Object Template. If there's complex spawn/destroy patterns that don't always use unique names this can
// cause UniqueComponentName to become a different name than the object it's being copied from which will cause anything attached to this to fail attachment.
FName UniqueComponentName = MakeUniqueObjectName(CachedObjectTemplate.Get(), InComponent->GetClass(), InComponent->GetFName());
+ UniqueComponentName = *FString(UniqueComponentName.ToString() + "_TKR");
Steps to Reproduce

Download the attachment zip to skip Step 1 and 2.

  1. Create a new project based on Third Person template.
  2. Modify BP_ThirdpersonCharacter and trigger SpawnSystemAttached for the root component to spawn Niagara FX (when pressing T key or something.) [Image Removed]
  3. Navigate Window > Cinematics > Take Recorder to open Take Recorder panels.
  4. Click  +Source button and select Player.
  5. Run PIE.
  6. Click record button.
  7. Press T periodically and see how the number of tracks increases. Ideally, each time a Niagara FX is spawned, the number of tracks should increase by one. In reality, however, the number increases only once every two spawn times. [Image Removed]

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-208896 in the post.

1
Login to Vote

Fixed
ComponentUE - Anim - Sequencer
Affects Versions5.3.2
Target Fix5.5
Fix Commit32170400
Main Commit32170420
CreatedMar 5, 2024
ResolvedMar 12, 2024
UpdatedMar 18, 2024