Description

After the second recording time, the event listener registration in FGeometryCollectionCacheAdapter::InitializeForRecord is skipped.
Here is a workaround :

		// We only need to register event handlers once, the first time we initialize.
//		if (CachedData.Num() == 0)	// workaround : comment out this condition
		{
			Chaos::FEventManager* EventManager = Solver->GetEventManager();
			if (EventManager)
			{
				if (SimulationParameters.bGenerateBreakingData || SimulationParameters.bGenerateGlobalBreakingData)
				{ 
					EventManager->RegisterHandler<Chaos::FBreakingEventData>(Chaos::EEventType::Breaking, const_cast<FGeometryCollectionCacheAdapter*>(this), &FGeometryCollectionCacheAdapter::HandleBreakingEvents);
				}

				if (SimulationParameters.bGenerateCollisionData || SimulationParameters.bGenerateGlobalCollisionData)
				{ 
					EventManager->RegisterHandler<Chaos::FCollisionEventData>(Chaos::EEventType::Collision, const_cast<FGeometryCollectionCacheAdapter*>(this), &FGeometryCollectionCacheAdapter::HandleCollisionEvents);
				}

				if (SimulationParameters.bGenerateTrailingData)
				{ 
					EventManager->RegisterHandler<Chaos::FTrailingEventData>(Chaos::EEventType::Trailing, const_cast<FGeometryCollectionCacheAdapter*>(this), &FGeometryCollectionCacheAdapter::HandleTrailingEvents);
				}
			}

 
Steps to Reproduce
  1. Open the repro project : [Link Removed]
  2. Start PIE to record geometry collection simulation in the /Game/P_ChaosNiagara level
  3. Save cache
  4. Open /Game/P_ChaosNiagaraPlay
  5. Start PIE and make sure some particle are displayed by trailing event.
  6. Quit PIE
  7. Open /Game/P_ChaosNiagara again
  8. Start PIE to record simulation
  9. Quit PIE
  10. Save cache
  11. Open /Game/P_ChaosNiagaraPlay
  12. Start PIE

Result:

Particle effects are not displayed because there is no event track in the cache.

Expected Result:

Save event tracks for each recording.

 

Have Comments or More Details?

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

0
Login to Vote

Unresolved
ComponentUE - Simulation - Physics - Destruction
Affects Versions5.4
Target Fix5.5
CreatedJul 23, 2024
UpdatedJul 26, 2024
View Jira Issue