Hi there,
is there any planned timeline to bring World Partition support into Cesium?
I mean the depreciated approach (with level loading) that is used now is not really worth a lot for UE5+
Cheers Claude
1 Like
CStoner
January 13, 2023, 10:24am
2
Bump… and hints regarding this topic?
No, sorry, we don’t currently have a timeline that we can share.
Any update? Will World Partition will be supported with Cesium in Unreal?
1 Like
bump! Would be great to have an overview if this is being explored / developed at the moment
We’re starting to look at it. Initial indications are that World Partition uses a 2D grid and is therefore unsuitable for use on a globe. But I just opened a PR to stop it from crashing, at least:
CesiumGS:ue5-main
← CesiumGS:public-is-poison
opened 06:36AM - 31 May 23 UTC
While playing around with World Partition, I ran into https://github.com/CesiumG… S/cesium-unreal/issues/941, where the Editor crashes when attempting to unload a level with World Partition and a Cesium Actor. The crash is caused by Unreal attempting to CastChecked our Actor to UMetaData. Our Actor is not a UMetaData, so this checked cast fails, which is treated as a fatal error.
This cast happens inside [FWorldPartitionActorDesc::Unload](https://github.com/EpicGames/UnrealEngine/blob/5.2.0-release/Engine/Source/Runtime/Engine/Private/WorldPartition/WorldPartitionActorDesc.cpp#L605). Basically if the Actor `IsPackageExternal` (docs helpfully say "returns true if object has a different package than its outer's package"), and also it has the `RF_Public` or `RF_Standalone` flags, then it will be CastChecked to `UMetaData`. Why? I really don't know. A large comment explains some cases where the Actor might _not_ be "package external" (ours is), but those don't seem to apply to us. There's no hint in a comment or otherwise why this cast of some random Actor to `UMetaData` could ever work, nevermind be a good idea. Perhaps you're wondering what `UMetaData` even is? The docs only say "An object that holds a map of key/value pairs", which doesn't really clear it up for me.
But fortunately, I happened to notice that this crash _only_ happens if the Actor is added via the Cesium Quick Add panel. If we instead add a Cesium3DTileset by dragging it in from the Place Actors panel, there's no problem. So I went spelunking through the UE source code, and learned that the Editor UI, when you drag in an Actor, creates it with _only_ the `RF_Transactional` flag, whereas our Quick Add panel also adds `RF_Public`.
So, I removed `RF_Public`. And the problem goes away.
I wish I could tell you what this flag actually does, and why it's there in the first place, but no. I think I added it originally because some of the very early DataSmith glTF import code I was looking at used it, maybe. But that code was mostly importing models as assets, so it was probably not the best example to follow. Or maybe I just thought "public" sounded good? 🤷 The docs say RF_Public means "Object is visible outside its package", which doesn't mean very much to me.
Long story short, removing `RF_Public` makes us consistent with the Place Actors panel, it fixes this bug, and it doesn't have any obvious negative side effects that I've noticed yet. So :shipit:?
Fixes #941
2 Likes
very much expectation for supponting for worldpartition~
Is the “2D grid on a 3D world” situation not a problem for you?
1 Like