[UE4]C++匯出LandScapeInfo,高度圖和MASK
阿新 • • 發佈:2019-01-10
TArray<UObject*> Results;
GetObjectsOfClass(ALandscapeProxy::StaticClass(), Results);
for(auto& Object:Results)
{
ALandscapeProxy *LandscapeProxy = Cast<ALandscapeProxy>(Object);
if(LandscapeProxy)
{
ALandscapeProxy*LandscapeInfo = LandscapeProxy->GetLandscapeInfo();
if(LandscapeInfo == nullptr)
continue;
for(int32 i = 0; i < LandscapeInfor->Layers.Num(); ++i)
{
ULandscapeLayerInfoObject* LayerInfo = LandscapeInfo->Layers[i].LayerInfoObj;
if(LayerInfo)
{
FString LayerName = "D:/" + LayerInfo->LayerName.ToString() + ".png";
LandscapeInfor->ExportLayer(LayerInfo, LayerName);
}
}
}
}