Currently, the ShowStats viewport option is automatically enabled when entering PIE and automatically disabled when exiting PIE. This forced disabling happens even if the option was enabled prior to entering PIE, which is not expected (it did work as expected up to UE 4.26). Also currently, the ShowStats option controls the visibility not only of actual stats, but also of all other on-screen messages, such as map warnings ("LIGHTING NEEDS TO BE REBUILT", "BLUEPRINT COMPILE ERROR", "TEXTURE STREAMING POOL OVER BUDGET"), messages added with UEngine::AddOnScreenDebugMessage(), and messages added using UViewportStatsSubsystem (which is odd since there is another console command "DisableAllScreenMessages" for that). As a result, important warnings and debug messages are disabled without request or knowledge of the user, which can lead to important problems remaining undetected.
The automatic enabling and disabling of the ShowStats option happens on SLevelViewport::StartPlayInEditorSession() and SLevelViewport::EndPlayInEditorSession(), respectively. Both of these functions result in the following call chain:
FSceneViewport::OnPlayWorldViewportSwapped()
FSceneViewport::SwapStatCommands()
FEditorViewportClient::SetEnabledStats()
FEditorViewportClient::HandleViewportStatDisableAll()
FEditorViewportClient::SetShowStats(false)
if (any specific stats enabled)
FEditorViewportClient::SetShowStats(true)
Note that FEditorViewportClient::SetEnabledStats() clears all stats, then sets only the ones requested. But upon clearing all stats, it also calls SetShowStats(false). Afterwards, it only calls SetShowStats(true) if there is at least one enabled stat. This is inconsistent with the Editor UI, which allows the ShowStats option to be enabled even while no specific stats are visible. And it is also undesireable, as explained above, since the ShowStats option currently also affects the visibility of other non-stat-related on-screen messages, including important warnings and debug messages.
Possible solutions would be to make FSceneViewport::SwapStatCommands() treat the global bShowStats flag as independent from the array of enabled stats, and/or to make non-stat-related on-screen messages not be affected by that flag (and only by the console command DisableAllScreenMessages).
1. Make a non-stat-related on-screen message appear on the viewport. Examples:
1.1. LIGHTING NEEDS TO BE REBUILT
1.2. BLUEPRINT COMPILE ERROR
1.3. TEXTURE STREAMING POOL OVER BUDGET
1.4. Any message added to the screen with UEngine::AddOnScreenDebugMessage()
1.5. Any message added to the screen with UViewportStatsSubsystem
2. Enable/disable the "Show Stats" option on the popup menu from the three dashes on the upper left corner of the viewport.
2.1. Note that the "Show Stats" option also affects other non-stat-related on-screen messages
3. Leave "Show Stats" enabled
4. Enter and Exit PIE
5. Note that "Show Stats" is now disabled, and that all on-screen messages are no longer visible
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-231730 in the post.
0 |
Component | UE - Editor - UI Systems |
---|---|
Affects Versions | 5.4, 4.27, 5.3, 5.5 |
Created | Nov 28, 2024 |
---|---|
Updated | Nov 29, 2024 |