We currently load tilesets that contain a hierarchy of CMPT files (unsurprisingly). Our CMPT files contain a collection of B3DM and I3DM components that are standardized across the tileset. We would like to be able to selectively toggle components, so that (for example) a particular I3DM (or even all I3DMs) are either loaded or not rendered when a CMPT file is loaded. Is there a current way to do this, down to and including somehow hooking the B3DM/I3DM loading process to be able to abort loading certain components?
I think there’s a lot of different ways to achieve this, but first, can you tell me a bit more about what you’re trying to do? Generally instead of thinking in terms of individual tiles, it’s often easier to think in terms of “features”. That way, with the styling language, you could hide/style meaningful units in your data (whether buildings, foliage, etc.) with something like the styling language https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling.
With that said, there’s some discussion here about getting/hiding individual tiles: https://github.com/AnalyticalGraphicsInc/cesium/issues/7426
Let me know if that helps at all!
Thanks for the quick response. For example, we want to show or hide the entire contents of an I3DM file that’s in every CMPT file in our tileset (which not hiding other B3DM and/or I3DM files that are in the CMPT files in the tileset). Regarding your styling suggestion, I see some intimation that you can apply batch information to each instance in an I3DM (and perhaps every instance, i.e., treat the entire I3DM as a single feature?), but I’m afraid I see little information on what’s required - do you happen to have a sample I3DM with batch information at which you could point me?
Because the issue you linked only gives you a way to turn off entire tiles, not a simple component of a CMPT, I suspect it doesn’t quite cover our use case. Thanks in advance.
I too also think having a way to store metadata in a batch table would be ideal for your use case (so either you can hide them easily with the styling language, like you said, have all of those i3dm tiles be considered one feature) or at least be able to traverse the tileset and pick out the feature for any more fine grained or custom manipulation.
The 3D Tiles specification is a good resource for this: https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/specification/TileFormats/Batched3DModel/README.md#batch-table
There’s some examples of tilesets with some per feature properties here: https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=3D%20Tiles%20Formats.html (you can see the styling language being used to style things by height here). Are you using Cesium ion to create your 3D Tilesets or something else?
We use our own custom tool that predated Ion to generate B3DM and I3DM files: https://github.com/Geopipe/gltf2glb/
While it supports just about everything in the batched model specification, the instanced model support is preliminary, so I’ll take a look at any of those examples that demonstrate per-instance properties.