Skip to content

Commit 8e90282

Browse files
authored
Merge pull request #1755 from CesiumGS/update-5.7
Fixes for Unreal 5.7
2 parents 1de23e9 + f1b2b29 commit 8e90282

34 files changed

+378
-404
lines changed

.github/actions/install-unreal-windows/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ runs:
3030
7z x -mmt=8 "D:/Program Files/Epic Games/UE.zip" "-oD:/Program Files/Epic Games/"
3131
del "D:/Program Files/Epic Games/UE.zip"
3232
- name: Install Unreal Engine (older versions)
33-
if: ${{ inputs.unreal-program-name != 'UE_5.6' }}
33+
if: ${{ inputs.unreal-program-name == 'UE_5.4' || inputs.unreal-program-name == 'UE_5.5' }}
3434
shell: pwsh
3535
run: |
3636
Start-Process "D:/Program Files/Epic Games/${{ inputs.unreal-program-name }}/Engine/Extras/Redist/en-us/UEPrereqSetup_x64.exe" -Args "-q" -Wait
3737
- name: Install Unreal Engine (5.6+)
38-
if: ${{ inputs.unreal-program-name == 'UE_5.6' }}
38+
if: ${{ inputs.unreal-program-name != 'UE_5.4' && inputs.unreal-program-name != 'UE_5.5' }}
3939
shell: pwsh
4040
run: |
4141
Start-Process "D:/Program Files/Epic Games/${{ inputs.unreal-program-name }}/Engine/Extras/Redist/en-us/vc_redist.x64.exe" -Args "-q" -Wait

.github/workflows/build.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,3 +390,121 @@ jobs:
390390
test-package-base-name: "CesiumForUnreal-56"
391391
visual-studio-version: "2022"
392392
visual-studio-components: "Microsoft.VisualStudio.Component.VC.14.38.17.8.x86.x64,Microsoft.VisualStudio.Component.Windows11SDK.22621"
393+
Windows57:
394+
uses: ./.github/workflows/buildWindows.yml
395+
secrets: inherit
396+
with:
397+
runner-label: "windows-2022"
398+
unreal-engine-version: "5.7.0"
399+
unreal-engine-zip: "s3://cesium-unreal-engine/5.7.0/UE_5.7.zip"
400+
unreal-program-name: "UE_5.7"
401+
upload-package-base-name: "CesiumForUnreal-57-windows"
402+
# These are specified in the Unreal Engine release notes under "IDE Version the Build farm compiles against"
403+
# and using them ensures we're compiling our plugin in the exact same way that Unreal Engine itself is compiled.
404+
cmake-generator: "Visual Studio 17 2022"
405+
cmake-toolchain: "version=14.44"
406+
cmake-platform: "x64,version=10.0.22621.0"
407+
visual-studio-version: "2022"
408+
visual-studio-components: "Microsoft.VisualStudio.Component.VC.14.44.17.14.x86.x64,Microsoft.VisualStudio.Component.Windows11SDK.22621"
409+
TestWindows57:
410+
needs: [Windows57]
411+
uses: ./.github/workflows/testWindows.yml
412+
secrets: inherit
413+
with:
414+
runner-label: windows-2022
415+
unreal-engine-zip: "s3://cesium-unreal-engine/5.7.0/UE_5.7.zip"
416+
unreal-program-name: "UE_5.7"
417+
test-package-base-name: "CesiumForUnreal-57-windows"
418+
Android57:
419+
uses: ./.github/workflows/buildAndroid.yml
420+
secrets: inherit
421+
with:
422+
runner-label: windows-2022
423+
unreal-engine-version: "5.7.0"
424+
unreal-engine-zip: "s3://cesium-unreal-engine/5.7.0/UE_5.7.zip"
425+
unreal-program-name: "UE_5.7"
426+
upload-package-base-name: "CesiumForUnreal-57-android"
427+
android-ndk-version: "r27c"
428+
Linux57:
429+
uses: ./.github/workflows/buildLinux.yml
430+
secrets: inherit
431+
with:
432+
runner-label: ubuntu-22.04
433+
unreal-engine-version: "5.7.0"
434+
unreal-engine-zip: "s3://cesium-unreal-engine/5.7.0/Linux_Unreal_Engine_5.7.0.zip"
435+
unreal-program-name: "UE_5.7"
436+
upload-package-base-name: "CesiumForUnreal-57-linux"
437+
clang-version: "v26_clang-20.1.8-rockylinux8"
438+
Apple57:
439+
uses: ./.github/workflows/buildApple.yml
440+
secrets: inherit
441+
with:
442+
runner-label: macos-14
443+
unreal-engine-version: "5.7.0"
444+
unreal-engine-zip: "s3://cesium-unreal-engine/5.7.0/UE_57-mac.zip"
445+
unreal-program-name: "UE_5.7"
446+
upload-package-base-name: "CesiumForUnreal-57-apple"
447+
xcode-version: "16.1"
448+
Combine57:
449+
runs-on: ubuntu-latest
450+
needs: [Windows57, Android57, Linux57, Apple57]
451+
steps:
452+
- name: Check out repository code
453+
uses: actions/checkout@v4
454+
- name: Set environment variables
455+
run: |
456+
export CESIUM_UNREAL_VERSION=$GITHUB_REF_NAME
457+
export BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-57-${CESIUM_UNREAL_VERSION}"
458+
export BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME="CesiumForUnreal-57-SourceOnly-${CESIUM_UNREAL_VERSION}"
459+
# Make these available to subsequent steps
460+
echo "CESIUM_UNREAL_VERSION=$CESIUM_UNREAL_VERSION" >> $GITHUB_ENV
461+
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=$BUILD_CESIUM_UNREAL_PACKAGE_NAME" >> $GITHUB_ENV
462+
echo "BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME=$BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME" >> $GITHUB_ENV
463+
- name: Download Apple build
464+
uses: actions/download-artifact@v4
465+
with:
466+
name: CesiumForUnreal-57-apple-${{ env.CESIUM_UNREAL_VERSION}}
467+
path: combine
468+
- name: Download Android build
469+
uses: actions/download-artifact@v4
470+
with:
471+
name: CesiumForUnreal-57-android-${{ env.CESIUM_UNREAL_VERSION}}
472+
path: combine
473+
- name: Download Linux build
474+
uses: actions/download-artifact@v4
475+
with:
476+
name: CesiumForUnreal-57-linux-${{ env.CESIUM_UNREAL_VERSION}}
477+
path: combine
478+
- name: Download Windows build
479+
uses: actions/download-artifact@v4
480+
with:
481+
name: CesiumForUnreal-57-windows-${{ env.CESIUM_UNREAL_VERSION}}
482+
path: combine
483+
- name: Publish combined package artifact
484+
if: ${{ success() }}
485+
uses: actions/upload-artifact@v4
486+
with:
487+
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
488+
path: combine
489+
- name: Publish combined package artifact for the Unreal Marketplace
490+
if: ${{ success() }}
491+
uses: actions/upload-artifact@v4
492+
with:
493+
name: ${{ env.BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME}}
494+
path: |
495+
combine
496+
# These are built by Epic, and including them seems to confuse their process.
497+
!combine/CesiumForUnreal/Binaries/**/*
498+
!combine/CesiumForUnreal/Intermediate/**/*
499+
TestPackage57:
500+
needs: [Combine57]
501+
uses: ./.github/workflows/testPackageOnWindows.yml
502+
secrets: inherit
503+
with:
504+
runner-label: windows-2022
505+
unreal-engine-zip: "s3://cesium-unreal-engine/5.7.0/UE_5.7.zip"
506+
unreal-program-name: "UE_5.7"
507+
unreal-engine-association: "5.7"
508+
test-package-base-name: "CesiumForUnreal-57"
509+
visual-studio-version: "2022"
510+
visual-studio-components: "Microsoft.VisualStudio.Component.VC.14.44.17.14.x86.x64,Microsoft.VisualStudio.Component.Windows11SDK.22621"

Documentation/Source/dev.Target.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ public class devTarget : TargetRules
66
public devTarget( TargetInfo Target) : base(Target)
77
{
88
Type = TargetType.Game;
9-
#if UE_5_4_OR_LATER
9+
#if UE_5_7_OR_LATER
10+
DefaultBuildSettings = BuildSettingsVersion.V6;
11+
#elif UE_5_4_OR_LATER
1012
DefaultBuildSettings = BuildSettingsVersion.V4;
1113
#else
1214
DefaultBuildSettings = BuildSettingsVersion.V2;

Documentation/Source/devEditor.Target.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ public class devEditorTarget : TargetRules
66
public devEditorTarget( TargetInfo Target) : base(Target)
77
{
88
Type = TargetType.Editor;
9-
#if UE_5_4_OR_LATER
9+
#if UE_5_7_OR_LATER
10+
DefaultBuildSettings = BuildSettingsVersion.V6;
11+
#elif UE_5_4_OR_LATER
1012
DefaultBuildSettings = BuildSettingsVersion.V4;
1113
#else
1214
DefaultBuildSettings = BuildSettingsVersion.V2;

Source/CesiumEditor/CesiumEditor.Build.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ public CesiumEditor(ReadOnlyTargetRules Target) : base(Target)
126126
}
127127
);
128128

129+
#if UE_5_7_OR_LATER
130+
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_7;
131+
#else
129132
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_2;
133+
#endif
130134
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
131135
CppStandard = CppStandardVersion.Cpp20;
132136
}

Source/CesiumRuntime/CesiumRuntime.Build.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target)
103103
"Json",
104104
"JsonUtilities",
105105
"Slate",
106-
"SlateCore"
106+
"SlateCore",
107+
"ChaosCore"
107108
}
108109
);
109110

@@ -156,8 +157,13 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target)
156157
}
157158
);
158159

159-
ShadowVariableWarningLevel = WarningLevel.Off;
160+
#if UE_5_7_OR_LATER
161+
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_7;
162+
CppCompileWarningSettings.ShadowVariableWarningLevel = WarningLevel.Off;
163+
#else
160164
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_4;
165+
ShadowVariableWarningLevel = WarningLevel.Off;
166+
#endif
161167
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
162168

163169
CppStandard = CppStandardVersion.Cpp20;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#include "CesiumCompat.h"
2+
#include "CesiumCommon.h"
3+
4+
FSceneInterfaceWrapper::FSceneInterfaceWrapper(
5+
FSceneInterface* InSceneInterface) {
6+
#if ENGINE_VERSION_5_7_OR_HIGHER
7+
this->ShaderPlatform = InSceneInterface->GetShaderPlatform();
8+
#endif
9+
this->RHIFeatureLevelType = InSceneInterface->GetFeatureLevel();
10+
}
11+
12+
FMaterialRelevance FSceneInterfaceWrapper::GetMaterialRelevance(
13+
UMeshComponent* InMeshComponent) const {
14+
#if ENGINE_VERSION_5_7_OR_HIGHER
15+
return InMeshComponent->GetMaterialRelevance(this->ShaderPlatform);
16+
#else
17+
return InMeshComponent->GetMaterialRelevance(this->RHIFeatureLevelType);
18+
#endif
19+
}
20+
21+
void ALevelInstance_SetDesiredRuntimeBehavior(
22+
ALevelInstance* Instance,
23+
ELevelInstanceRuntimeBehavior RuntimeBehavior) {
24+
#if WITH_EDITORONLY_DATA && ENGINE_VERSION_5_7_OR_HIGHER
25+
Instance->SetDesiredRuntimeBehavior(RuntimeBehavior);
26+
#elif WITH_EDITORONLY_DATA
27+
Instance->DesiredRuntimeBehavior = RuntimeBehavior;
28+
#endif
29+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright 2020 - 2025 CesiumGS, Inc.and Contributors
2+
3+
#pragma once
4+
5+
#include "CesiumCommon.h"
6+
#include "Components/MeshComponent.h"
7+
#include "LevelInstance/LevelInstanceActor.h"
8+
#include "RHIFeatureLevel.h"
9+
#include "RHIShaderPlatform.h"
10+
#include "SceneInterface.h"
11+
12+
/**
13+
* Wrapper around FSceneInterface to deal with the switch to EShaderPlatform in
14+
* Unreal 5.7.
15+
*/
16+
struct FSceneInterfaceWrapper {
17+
FSceneInterfaceWrapper(FSceneInterface* SceneInterface);
18+
19+
FMaterialRelevance
20+
GetMaterialRelevance(UMeshComponent* InMeshComponent) const;
21+
22+
ERHIFeatureLevel::Type RHIFeatureLevelType;
23+
24+
#if ENGINE_VERSION_5_7_OR_HIGHER
25+
private:
26+
EShaderPlatform ShaderPlatform;
27+
#endif
28+
};
29+
30+
/**
31+
* Compatibility fix for the DesiredRuntimeBehavior -> SetDesiredRuntimeBehavior
32+
* change in Unreal 5.7.
33+
*/
34+
void ALevelInstance_SetDesiredRuntimeBehavior(
35+
ALevelInstance* Instance,
36+
ELevelInstanceRuntimeBehavior RuntimeBehavior);

Source/CesiumRuntime/Private/CesiumGeoreference.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "Cesium3DTileset.h"
66
#include "CesiumActors.h"
77
#include "CesiumCommon.h"
8+
#include "CesiumCompat.h"
89
#include "CesiumCustomVersion.h"
910
#include "CesiumGeospatial/Cartographic.h"
1011
#include "CesiumGlobeAnchorComponent.h"
@@ -781,8 +782,9 @@ void ACesiumGeoreference::_createSubLevelsFromWorldComposition() {
781782
FRotator::ZeroRotator,
782783
spawnParameters);
783784
pLevelInstance->SetIsSpatiallyLoaded(false);
784-
pLevelInstance->DesiredRuntimeBehavior =
785-
ELevelInstanceRuntimeBehavior::LevelStreaming;
785+
ALevelInstance_SetDesiredRuntimeBehavior(
786+
pLevelInstance,
787+
ELevelInstanceRuntimeBehavior::LevelStreaming);
786788
pLevelInstance->SetActorLabel(pFound->LevelName);
787789

788790
FString levelPath = level.PackageName.ToString() + "." +

Source/CesiumRuntime/Private/CesiumGltfComponent.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "CesiumTransforms.h"
1919
#include "Chaos/AABBTree.h"
2020
#include "Chaos/CollisionConvexMesh.h"
21+
#include "Chaos/Core.h"
2122
#include "Chaos/TriangleMeshImplicitObject.h"
2223
#include "CreateGltfOptions.h"
2324
#include "EncodedFeaturesMetadata.h"
@@ -3259,7 +3260,7 @@ static void loadPrimitiveGameThreadPart(
32593260
NAME_None,
32603261
RF_Transactional);
32613262
pBaseAsMaterialInstance->AddAssetUserData(pCesiumData);
3262-
pCesiumData->PostEditChangeOwner();
3263+
pCesiumData->UpdateLayerNames();
32633264
}
32643265
}
32653266
#endif
@@ -3853,7 +3854,7 @@ static Chaos::FTriangleMeshImplicitObjectPtr BuildChaosTriangleMeshes(
38533854
Chaos::TParticles<Chaos::FRealSingle, 3> vertices;
38543855
vertices.AddParticles(vertexCount);
38553856
for (uint32 i = 0; i < vertexCount; ++i) {
3856-
vertices.X(int32(i)) = positionBuffer.VertexPosition(i);
3857+
vertices.SetX(int32(i), positionBuffer.VertexPosition(i));
38573858
}
38583859

38593860
int32 triangleCount = indices.Num() / 3;

0 commit comments

Comments
 (0)