Visibility toggle bug

Hi,

We’ve encountered a bug in pathtracer where if a static mesh in the scene has Affect Indirect Lighting While Hidden turned on, it’s visibility in the Outliner cannot be turned off. (Turning off Visibility in the Details panel works as expected).

Thanks.

Steps to Reproduce
Described above

Hi [mention removed]​,

Thanks for the report. I reproduced this issue in UE 5.6 and a recent source build from the Main P4 stream.

There’s an issue in the UPrimitiveComponent::ShouldComponentAddToScene() method that ignores the request to hide the primitive when toggled via the Outliner eye icon.

When Affect Indirect Lighting While Hidden is enabled, the component remains added to the scene even if the actor is marked as hidden in the editor, causing it to stay visible although it cannot be selected or interacted with.

A workaround for this is to modify the return line in UPrimitiveComponent::ShouldComponentAddToScene() to:

return bSceneAdd && !bIsTemporarilyHiddenInEditor && (ShouldRender() || ((bCastHiddenShadow || bAffectIndirectLightingWhileHidden) && !bIsHiddenInEditor) || bRayTracingFarField);With this change in place, hiding via the Outliner fully removes the component from the scene in the editor evenwhen bAffectIndirectLightingWhileHidden is set to true.

I’ll submit a bug report for this problem, but in the meantime please let me know if this workaround helps you.

Best,

Francisco

Hello [mention removed]​,

I’ve submitted an internal bug report for this issue under UE-352621, which tracks the visibility issue when Affect Indirect Lighting While Hidden is enabled and the actor is hidden via the Outliner.

You can follow progress once it becomes publicly available here: https://issues.unrealengine.com/issue/UE-352621

In the meantime, please continue using the workaround I shared earlier, which modifies the return statement in UPrimitiveComponent::ShouldComponentAddToScene() to properly account for temporary editor hide states.

If there’s anything else blocking you or any additional detail you need regarding this case, please let me know.

Best,

Francisco