From 0f85a433bf4475b7b368974815cb1ccff442b0d2 Mon Sep 17 00:00:00 2001 From: Julot Date: Tue, 4 Nov 2025 11:25:00 +0100 Subject: [PATCH] SceneCaptures: take the show-only / hidden list of actors into consideration Following a crash report: in the user's scene, a scene capture component configured to render only a specific actor was causing the Cesium tileset to request a huge amount of data (wheras the tileset was not seen by the capture component...) --- Source/CesiumRuntime/Private/Cesium3DTileset.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Source/CesiumRuntime/Private/Cesium3DTileset.cpp b/Source/CesiumRuntime/Private/Cesium3DTileset.cpp index 7b1984758..911d770f9 100644 --- a/Source/CesiumRuntime/Private/Cesium3DTileset.cpp +++ b/Source/CesiumRuntime/Private/Cesium3DTileset.cpp @@ -1503,6 +1503,22 @@ std::vector ACesium3DTileset::GetSceneCaptures() const { continue; } + // Take the show-only / hidden list of actors into consideration + bool bDoesSceneCaptureRenderTileset = false; + if (pSceneCaptureComponent->PrimitiveRenderMode == + ESceneCapturePrimitiveRenderMode::PRM_UseShowOnlyList) { + bDoesSceneCaptureRenderTileset = + pSceneCaptureComponent->ShowOnlyActors.ContainsByPredicate( + [this](auto const& ActorPtr) { return this == ActorPtr; }); + } else { + bDoesSceneCaptureRenderTileset = + !pSceneCaptureComponent->HiddenActors.ContainsByPredicate( + [this](auto const& ActorPtr) { return this == ActorPtr; }); + } + if (!bDoesSceneCaptureRenderTileset) { + continue; + } + FVector2D renderTargetSize(pRenderTarget->SizeX, pRenderTarget->SizeY); if (renderTargetSize.X < 1.0 || renderTargetSize.Y < 1.0) { continue;