Cesium for UE 5.1

Anyone had any luck compiling Cesium for UE 5.1 Preview 2?

I’ve spent a day trying to make it compile but no luck so far as the errors are beyond my level of C++ knowledge. Cesium native compiled without any problems but the cesium plugin itself is the one I’m struggling with. I’ve used latest from ue5-main branch.

When trying to compile the plugin I’m getting following errors:

1>Building 10 actions with 10 processes…
1>[1/10] Link UnrealEditor-CesiumEditor.lib cancelled
1>[2/10] Compile Module.CesiumEditor.cpp
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumEditor\Private\CesiumPanel.h(5): fatal error C1083: Cannot open include file: ‘Dialogs/CustomDialog.h’: No such file or directory
1>[3/10] Compile Module.CesiumRuntime.6_of_6.cpp
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\ScreenCreditsWidget.cpp(221): error C4668: ‘ENGINE_MAJOR_VERSION’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\ScreenCreditsWidget.cpp(226): warning C4996: ‘UTexture2D::PlatformData’: Use GetPlatformData() / SetPlatformData() accessors instead. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\ScreenCreditsWidget.cpp(227): warning C4996: ‘UTexture2D::PlatformData’: Use GetPlatformData() / SetPlatformData() accessors instead. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\ScreenCreditsWidget.cpp(251): error C4668: ‘ENGINE_MAJOR_VERSION’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\ScreenCreditsWidget.cpp(256): warning C4996: ‘UTexture2D::PlatformData’: Use GetPlatformData() / SetPlatformData() accessors instead. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\ScreenCreditsWidget.cpp(257): warning C4996: ‘UTexture2D::PlatformData’: Use GetPlatformData() / SetPlatformData() accessors instead. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
1>[4/10] Compile Module.CesiumRuntime.2_of_6.cpp
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumGltfComponent.h(25): error C4668: ‘PHYSICS_INTERFACE_PHYSX’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>[5/10] Compile Module.CesiumRuntime.4_of_6.cpp
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumGltfComponent.h(25): error C4668: ‘PHYSICS_INTERFACE_PHYSX’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\LoadGltfResult.h(23): error C4668: ‘PHYSICS_INTERFACE_PHYSX’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\LoadGltfResult.h(50): error C4668: ‘PHYSICS_INTERFACE_PHYSX’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CreateGltfOptions.h(11): error C4668: ‘PHYSICS_INTERFACE_PHYSX’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CreateGltfOptions.h(22): error C4668: ‘PHYSICS_INTERFACE_PHYSX’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\Cesium3DTileset.cpp(48): fatal error C1083: Cannot open include file: ‘IPhysXCookingModule.h’: No such file or directory
1>[6/10] Compile Module.CesiumRuntime.5_of_6.cpp
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumGltfComponent.h(25): error C4668: ‘PHYSICS_INTERFACE_PHYSX’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumEncodedMetadataComponent.cpp(292): error C2039: ‘FunctionExpressions’: is not a member of ‘UMaterialFunctionMaterialLayer’
1>C:\Program Files\Epic Games\UE_5.1\Engine\Source\Runtime\Engine\Classes\Materials\MaterialFunctionMaterialLayer.h(16): note: see declaration of ‘UMaterialFunctionMaterialLayer’
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumEncodedMetadataComponent.cpp(292): error C2143: syntax error: missing ‘;’ before ‘:’
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumEncodedMetadataComponent.cpp(292): error C2143: syntax error: missing ‘;’ before ‘)’
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumEncodedMetadataComponent.cpp(347): error C2039: ‘FunctionExpressions’: is not a member of ‘UMaterialFunctionMaterialLayer’
1>C:\Program Files\Epic Games\UE_5.1\Engine\Source\Runtime\Engine\Classes\Materials\MaterialFunctionMaterialLayer.h(16): note: see declaration of ‘UMaterialFunctionMaterialLayer’
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumEncodedMetadataComponent.cpp(748): error C2039: ‘FunctionExpressions’: is not a member of ‘UMaterialFunctionMaterialLayer’
1>C:\Program Files\Epic Games\UE_5.1\Engine\Source\Runtime\Engine\Classes\Materials\MaterialFunctionMaterialLayer.h(16): note: see declaration of ‘UMaterialFunctionMaterialLayer’
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumEncodedMetadataComponent.cpp(747): error C2143: syntax error: missing ‘;’ before ‘:’
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumEncodedMetadataComponent.cpp(748): error C2143: syntax error: missing ‘;’ before ‘)’
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumEncodedMetadataComponent.cpp(772): error C2039: ‘FunctionExpressions’: is not a member of ‘UMaterialFunctionMaterialLayer’
1>C:\Program Files\Epic Games\UE_5.1\Engine\Source\Runtime\Engine\Classes\Materials\MaterialFunctionMaterialLayer.h(16): note: see declaration of ‘UMaterialFunctionMaterialLayer’
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumEncodedMetadataComponent.cpp(771): error C2143: syntax error: missing ‘;’ before ‘:’
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumEncodedMetadataComponent.cpp(772): error C2143: syntax error: missing ‘;’ before ‘)’
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumEncodedMetadataComponent.cpp(795): error C2039: ‘FunctionExpressions’: is not a member of ‘UMaterialFunctionMaterialLayer’
1>C:\Program Files\Epic Games\UE_5.1\Engine\Source\Runtime\Engine\Classes\Materials\MaterialFunctionMaterialLayer.h(16): note: see declaration of ‘UMaterialFunctionMaterialLayer’
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumEncodedMetadataComponent.cpp(794): error C2143: syntax error: missing ‘;’ before ‘:’
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumEncodedMetadataComponent.cpp(795): error C2143: syntax error: missing ‘;’ before ‘)’
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumEncodedMetadataComponent.cpp(816): error C2039: ‘FunctionExpressions’: is not a member of ‘UMaterialFunctionMaterialLayer’
1>C:\Program Files\Epic Games\UE_5.1\Engine\Source\Runtime\Engine\Classes\Materials\MaterialFunctionMaterialLayer.h(16): note: see declaration of ‘UMaterialFunctionMaterialLayer’
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumEncodedMetadataComponent.cpp(825): error C2039: ‘FunctionExpressions’: is not a member of ‘UMaterialFunctionMaterialLayer’
1>C:\Program Files\Epic Games\UE_5.1\Engine\Source\Runtime\Engine\Classes\Materials\MaterialFunctionMaterialLayer.h(16): note: see declaration of ‘UMaterialFunctionMaterialLayer’
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\LoadGltfResult.h(23): error C4668: ‘PHYSICS_INTERFACE_PHYSX’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\LoadGltfResult.h(50): error C4668: ‘PHYSICS_INTERFACE_PHYSX’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CreateGltfOptions.h(11): error C4668: ‘PHYSICS_INTERFACE_PHYSX’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CreateGltfOptions.h(22): error C4668: ‘PHYSICS_INTERFACE_PHYSX’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumGltfComponent.cpp(54): error C4668: ‘PHYSICS_INTERFACE_PHYSX’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumGltfComponent.cpp(308): error C4668: ‘PHYSICS_INTERFACE_PHYSX’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumGltfComponent.cpp(1197): error C4668: ‘PHYSICS_INTERFACE_PHYSX’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumGltfComponent.cpp(2068): error C4668: ‘PHYSICS_INTERFACE_PHYSX’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\CesiumRuntime\Private\CesiumGltfComponent.cpp(2420): error C4668: ‘PHYSICS_INTERFACE_PHYSX’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>[7/10] Link UnrealEditor-CesiumRuntime.lib cancelled
1>[8/10] Link UnrealEditor-CesiumRuntime.dll cancelled
1>[9/10] Link UnrealEditor-CesiumEditor.dll cancelled
1>[10/10] WriteMetadata devEditor.target cancelled
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command ““C:\Program Files\Epic Games\UE_5.1\Engine\Build\BatchFiles\Build.bat” devEditor Win64 Development -Project=“C:\Dev\cesium-unreal-samples\CesiumForUnrealSamples.uproject” -WaitMutex -FromMsBuild” exited with code -1.
1>Done building project “CesiumForUnrealSamples.vcxproj” – FAILED.

One of the issues seems to be that there’s no PhysX available in UE5.1. I have edited the cesium plugin code to not use PhysX but other issues still remain which I’m struggling to fix.

Anyone got any pointers on how to proceed?

Cheers

Is the CesiumForUnreal Plugin not updated for 5.1 yet?
I ran into a similar issue in Preview 1 but will be trying it out again.

No, it has not been updated for 5.1 yet. We hope to do that soon. In the meantime, if you’re able to figure it out we would welcome a pull request.

1 Like

Hi all, Kevin, can you please give any estimation to how soon can we expect this update from your team? I do understand it has to take some work, but I am pressured by a deadline in a project - haha a lot depends on your update now! :wink:

Hi @Dominik_Gomolka,

I don’t think the Cesium team will be able to work on this in time for the early December release, which means it unlikely to be available in an official release before early January. Sorry it’s not better news.

Kevin

Hello @Kevin_Ring Thank you for the clear answer here! I’ll find a work-around for this one and be back with Cesium in the future :slight_smile:

I’ve just opened a pull request that gets the plugin working in UE 5.1:

We don’t have any UE 5.1 automated build set up yet, though, so you’ll have to build it yourself. If you try it out, let me know how it works.

Just built it on my machine from the latest commit on UE51 branch. Compiled without any problem. Plugin seems to be working fine so far. Thanks for your efforts!

Hello,

I am a newbie and have never built a plugin from source. I have a tight deadline and I really have to get Cesium working with UE 5.1. Can you please please help me with how to build this plugin and make it work inside UE 5.1 ? I will much appreciate this support. Please help !

The Documentation for building from source is located here.
Overview and Windows and Packaging

I’m still having some various issues but managed to get my project to open for 5.1 with some tweaking, although i still couldn’t fully compile for Windows/Linux. This is what i tried.

  1. I cloned the ue51 branch recursively to also get the required cesium-native content
    git clone -b ue51 https://github.com/CesiumGS/cesium-unreal.git --recursive
  2. I used VS2019 on the local folder cesium-unreal\extern
  3. Then, in the “Solution Explorer - Folder View”, right-click on the root CMakeLists.txt and select “Install”

At this point I believe the cesium-unreal\Source\ThirdParty folder is populated with the required headers and libraries.

I set my working directory to where my installation is, in this case
N:\UnrealEngine-5.1.0-release\Engine\Build\BatchFiles
and execute the following command

./RunUAT.bat BuildPlugin -Plugin='C:\Users\Workstation\Documents\Github\cesium-unreal\CesiumForUnreal.uplugin' -Package="../packages/CesiumForUnreal" -CreateSubFolder -TargetPlatform=Windows

I get various warnings and errors during this processes, i think because i don’t have all the OS Platforms ready (i.e Android, Linux, etc)
However, after it’s done a new Folder is created at
N:\packages\CesiumForUnreal\HostProject\Plugins\CesiumForUnreal
I copy this folder to my Projects /Plugins folder.

However, I still run into issues
UATHelper: Packaging (Linux): [1/5] Compile Module.CesiumRuntime.1_of_6.cpp
UATHelper: Packaging (Linux): In file included from C:/Users/Workstation/Documents/Unreal Projects/arnobeta_v5.1/Intermediate/Build/Linux/B4D820EA/arnocMain/Development/CesiumRuntime/Module.CesiumRuntime.1_of_6.cpp:6:
UATHelper: Packaging (Linux): In file included from C:/Users/Workstation/Documents/Unreal Projects/arnobeta_v5.1/Intermediate/Build/Linux/B4D820EA/arnocMain/Inc/CesiumRuntime/UHT/CesiumBoundingVolumeComponent.gen.cpp:8:
UATHelper: Packaging (Linux): In file included from C:/Users/Workstation/Documents/Unreal Projects/arnobeta_v5.1/Plugins/cesium-unreal/Source\CesiumRuntime/Private/CesiumBoundingVolumeComponent.h:5:
UATHelper: Packaging (Linux): In file included from C:/Users/Workstation/Documents/Unreal Projects/arnobeta_v5.1/Plugins/cesium-unreal/Source/CesiumRuntime/Private/CesiumViewExtension.h:6:
UATHelper: Packaging (Linux): In file included from .\Runtime/Renderer/Private/ScenePrivate.h:33:
UATHelper: Packaging (Linux): In file included from .\Runtime/Renderer/Private/LightSceneInfo.h:15:
UATHelper: Packaging (Linux): In file included from .\Runtime/Renderer/Private/SceneRendering.h:29:
UATHelper: Packaging (Linux): In file included from .\Runtime/Renderer/Private/SkyAtmosphereRendering.h:15:
UATHelper: Packaging (Linux): N:\UnrealEngine-5.1.0-release\Engine\Source\Runtime\Renderer\Private\VirtualShadowMaps\VirtualShadowMapArray.h(7,10): fatal error: ‘MeshDrawCommands.h’ file not found
UATHelper: Packaging (Linux): #include “MeshDrawCommands.h”
UATHelper: Packaging (Linux): ^~~~~~~~~~~~~~~~~~~~
UATHelper: Packaging (Linux): 1 error generated.
PackagingResults: Error: ‘MeshDrawCommands.h’ file not found

@Nishant_Ambekar as @Darb_Dude mentioned, the build instructions are available in the GitHub repo. I’d suggest using the version of the instructions for UE5, which are slightly different from the UE4 instructions Darb_Dude linked. Here are the UE5 instructions:

So start there and let us know if you run into trouble.

I hope to get our CI system building for UE5.1 soon. Once that’s done you’ll be able to just download a package rather than building it yourself. But it’ll be the end of next week at the soonest before that is ready.

Kevin

I have this issue as well,

I’ve done some investigating into this and turned it into an issue on the Cesium For Unreal github here. If you have any other discoveries feel free to add them to this discussion as it may help. By what I can tell, the error occurs when building for Linux. Building for Windows should work just fine.

In UE5.1 they have changed how they included some header files and my best guess is that the windows build tool has these paths inside their include directories. Whereas with the Linux build tools they don’t. This is just speculation as I am still investigating this.

I have now just opened a pull request that I believe has fixed this issue.

@Kevin_Ring I would wait until your release scheduled this week end, as it’s very complex for me to build from source. Pl note that we are banking on this release, as we have to deliver certain tasks within our deadline. Hence, kindly ensure that the release happens this week end.

Cheers

Sorry, but we absolutely cannot promise that will work out well for you. I hope to get UE5.1 support into this week’s release, but there are a great many things that could go wrong. If your business is depending on it, you need a plan B.

Hello @Kevin_Ring ,

Want to check with you, if you can give us some timeline or an approximate range of time, in which the Cesium for UE 5.1 will be out ? We have kept our client on hold for this, as we are waiting for this update.

Thankyou.

We released it to Epic last week, but so far they haven’t reviewed it and published it on the Marketplace. But you can install it from our releases page on GitHub today:

Uninstall the existing version of the plugin using the Epic Launcher, then download the appropriate ZIP from the page above and extract it to your UE installation’s Engine/Plugins/Marketplace directory.

Note that we’ve had some reports about crashes on macOS and Linux. We expect to release a v1.21.1 to fix those problems very soon.

1 Like