Description

This problem seems to occur because Rotation is not taken into account when calculating Weight.
I have confirmed that it can be solved by calculating the rotation as follows.

float ULandscapeComponent::GetLayerWeightAtLocation(const FVector& InLocation, ULandscapeLayerInfoObject* LayerInfo, TArray<uint8>* LayerCache)
{
... 1991
// Find location
// TODO: Root landscape isn't always loaded, would Proxy suffice?
if (ALandscape* Landscape = GetLandscapeActor())
{
    const FVector DrawScale = Landscape->GetRootComponent()->GetRelativeScale3D();
    const FRotator DrawRotator = Landscape->GetRootComponent()->GetRelativeRotation(); //add
    FVector TestPosition = ((DrawRotator.UnrotateVector(InLocation - Landscape->GetActorLocation())) / DrawScale); //add

    float TestX = TestPosition.X - (float)GetSectionBase().X; //add
    float TestY = TestPosition.Y - (float)GetSectionBase().Y; //add

    // Abort if the test location is not on this component
    if (TestX < 0 || TestY < 0 || TestX > ComponentSizeQuads || TestY > ComponentSizeQuads)
    {
        return 0.0f;
    }
...
}
Steps to Reproduce

1. Open Landscape.umap in Content Example
[Image Removed]

2. Set Soil to Landscape Layers of Foliage
[Image Removed]

3. At this time, we should be able to generate Foliage only for the Soil part, but if the rotation value is set to Landscape, it will be an incorrect generation position.

Have Comments or More Details?

There's no existing public thread on this issue, so head over toAnswerHub just mention UE-89079 in the post.

0
Login to Vote

Fixed
ComponentTools - Landscape
Affects Versions4.234.24
Target Fix4.26
Fix Commit12372649
Main Commit12372649
CreatedFeb 19, 2020
ResolvedMar 23, 2020
UpdatedMar 23, 2020