Default to using the lowest LOD for mesh vis

This commit is contained in:
Steve Streeting 2022-07-25 16:48:59 +01:00
parent e210759e7b
commit 047d90d66b
2 changed files with 8 additions and 3 deletions

View File

@ -111,7 +111,7 @@ FPrimitiveSceneProxy* UStevesEditorVisComponent::CreateSceneProxy()
if (IsValid(Mesh.Mesh))
{
const FTransform CombinedXForm = FTransform(Mesh.Rotation, Mesh.Location, Mesh.Scale) * XForm;
const FStaticMeshLODResources& Lod = Mesh.Mesh->GetLODForExport(0);
const FStaticMeshLODResources& Lod = Mesh.Mesh->GetLODForExport(Mesh.bUseLowestLOD ? Mesh.Mesh->GetNumLODs() - 1 : 0);
TArray<FDynamicMeshVertex> Vertices;
TArray<uint32> Indices;

View File

@ -263,17 +263,22 @@ struct STEVESUEHELPERS_API FStevesEditorVisMesh
/// The colour of the line render
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FColor Colour;
/// Whether to use the lowest detail LOD for vis
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool bUseLowestLOD = true;
FStevesEditorVisMesh(UStaticMesh* InMesh,
const FVector& InLocation,
const FVector& InScale,
const FRotator& InRot,
const FColor& InColour) :
const FColor& InColour,
bool InUseLowestLOD = true) :
Mesh(InMesh),
Location(InLocation),
Scale(InScale),
Rotation(InRot),
Colour(InColour)
Colour(InColour),
bUseLowestLOD(InUseLowestLOD)
{
}