@@ -322,7 +322,7 @@ FUnrealLandscapeTranslator::CreateHeightfieldFromLandscape(
322
322
HeightData,
323
323
XSize, YSize,
324
324
Min, Max,
325
- LandscapeTransform ,
325
+ LandscapeActorTransform. GetScale3D () ,
326
326
HeightfieldFloatValues,
327
327
HeightfieldVolumeInfo))
328
328
{
@@ -494,7 +494,7 @@ FUnrealLandscapeTranslator::CreateHeightfieldFromLandscape(
494
494
// --------------------------------------------------------------------------------------------------
495
495
TArray<float > LayerHeightFloatData;
496
496
if (!ConvertLandscapeDataToHeightFieldData (
497
- LayerHeightData, XSize, YSize, Min, Max, LandscapeTransform ,
497
+ LayerHeightData, XSize, YSize, Min, Max, LandscapeActorTransform. GetScale3D () ,
498
498
LayerHeightFloatData, LayerVolumeInfo))
499
499
return false ;
500
500
@@ -653,7 +653,7 @@ FUnrealLandscapeTranslator::CreateHeightfieldFromLandscapeComponent(
653
653
654
654
FVector CenterOffset = FVector::ZeroVector;
655
655
if ( !ConvertLandscapeDataToHeightFieldData (
656
- HeightData, XSize, YSize, Min, Max, LandscapeComponentTransform,
656
+ HeightData, XSize, YSize, Min, Max, LandscapeComponentTransform. GetScale3D () ,
657
657
HeightfieldFloatValues, HeightfieldVolumeInfo) )
658
658
return false ;
659
659
@@ -790,7 +790,7 @@ FUnrealLandscapeTranslator::CreateInputNodeForLandscape(
790
790
TArray<float > HeightfieldFloatValues;
791
791
792
792
if (!ConvertLandscapeDataToHeightFieldData (
793
- HeightData, XSize, YSize, Min, Max, LandscapeTransform,
793
+ HeightData, XSize, YSize, Min, Max, LandscapeTransform. GetScale3D () ,
794
794
HeightfieldFloatValues, HeightfieldVolumeInfo))
795
795
return false ;
796
796
@@ -1240,7 +1240,7 @@ FUnrealLandscapeTranslator::ConvertLandscapeDataToHeightFieldData(
1240
1240
int32 YSize,
1241
1241
FVector Min,
1242
1242
FVector Max,
1243
- const FTransform& LandscapeActorTransform ,
1243
+ const FVector3d & LandscapeActorScale ,
1244
1244
TArray<float >& HeightfieldFloatValues,
1245
1245
HAPI_VolumeInfo& HeightfieldVolumeInfo)
1246
1246
{
@@ -1276,7 +1276,7 @@ FUnrealLandscapeTranslator::ConvertLandscapeDataToHeightFieldData(
1276
1276
1277
1277
// Spacing used to convert from uint16 to meters
1278
1278
double ZSpacing = 512.0 / ((double )UINT16_MAX);
1279
- ZSpacing *= (( double )LandscapeActorTransform. GetScale3D (). Z ) ;
1279
+ ZSpacing *= LandscapeActorScale. Z / 100.0 ;
1280
1280
1281
1281
// Center value in meters (Landscape ranges from [-255:257] meters at default scale
1282
1282
double ZCenterOffset = 32767 ;
@@ -1316,12 +1316,11 @@ FUnrealLandscapeTranslator::ConvertLandscapeDataToHeightFieldData(
1316
1316
HapiTransform.position [0 ] = 0 .0f ;
1317
1317
HapiTransform.position [2 ] = 0 .0f ;
1318
1318
1319
- FVector Scale = LandscapeActorTransform.GetScale3D ();
1320
- HapiTransform.scale [0 ] = Scale.Y * 0 .5f * HoudiniXSize;
1321
- HapiTransform.scale [1 ] = Scale.X * 0 .5f * HoudiniYSize;
1319
+ HapiTransform.scale [0 ] = LandscapeActorScale.Y * 0 .5f * HoudiniXSize / 100 .0f ;
1320
+ HapiTransform.scale [1 ] = LandscapeActorScale.X * 0 .5f * HoudiniYSize / 100 .0f ;
1322
1321
HapiTransform.scale [2 ] = 0 .5f ;
1323
1322
if (bUseDefaultUE4Scaling)
1324
- HapiTransform.scale [2 ] *= Scale .Z ;
1323
+ HapiTransform.scale [2 ] *= LandscapeActorScale .Z ;
1325
1324
1326
1325
HapiTransform.shear [0 ] = 0 .0f ;
1327
1326
HapiTransform.shear [1 ] = 0 .0f ;
0 commit comments