Description

The approximate size for a Static Mesh that is shown in the tooltip from hovering over a Static Mesh in the Content Browser and the approximate size shown in the Static Mesh Editor can be inconsistent. This is due to the former rounding to the nearest int while the latter casts directly to an int32.

The following are the two relevant blocks of code.
Asset registry tag portion:

const FString ApproxSizeStr = FString::Printf(TEXT("%dx%dx%d"), FMath::RoundToInt(Bounds.BoxExtent.X * 2.0f), FMath::RoundToInt(Bounds.BoxExtent.Y * 2.0f), FMath::RoundToInt(Bounds.BoxExtent.Z * 2.0f)); 

Static Mesh Editor portion:

 TextItems.Add(SStaticMeshEditorViewport::FOverlayTextItem(
         FText::Format(NSLOCTEXT("UnrealEd", "ApproxSize_F", "Approx Size: {0}x{1}x{2}"),
         FText::AsNumber(int32(StaticMesh->GetBounds().BoxExtent.X * 2.0f)), // x2 as artists wanted length not radius
         FText::AsNumber(int32(StaticMesh->GetBounds().BoxExtent.Y * 2.0f)),
         FText::AsNumber(int32(StaticMesh->GetBounds().BoxExtent.Z * 2.0f)))));
 

Regression?: No
This code was also present in 4.14

Steps to Reproduce

N/A - Code issue

Have Comments or More Details?

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

1
Login to Vote

Won't Fix
ComponentTools
Affects Versions4.144.154.16
CreatedMay 3, 2017
ResolvedAug 18, 2021
UpdatedAug 18, 2021
View Jira Issue