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)) if (IsValid(Mesh.Mesh))
{ {
const FTransform CombinedXForm = FTransform(Mesh.Rotation, Mesh.Location, Mesh.Scale) * XForm; 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<FDynamicMeshVertex> Vertices;
TArray<uint32> Indices; TArray<uint32> Indices;

View File

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