I have a city model containing a bunch of buildings in .dae format, extracted from Google Earth .kmz files, each in their structured directory. I want this city model to be published as 3D Tiles and color the buildings by their attributes, for example by their street names.
I worked through quite a long way using dae2gltf, gltf-pipeline and finally glbtob3dm. It appears to me, however, that even if I manage to provide the tileset.json, there's no way I can bind the attributes to the building model.
To do that I'll need at least a BATCH_ID for each building model. But glbtob3dm does not automatically provide a BATCH_ID or option to attach an BATCH_ID to the model so that's not possible.
Batch ids are definitely the main missing element here, and styling is not possible without them. Are you already batching individual buildings together into b3dm tiles? During that process you will need to assign batch ids. As you’ve noticed the open source tools don’t support batch ids at the moment so this work is up to you. I left a few notes on another thread that might be helpful: https://groups.google.com/d/msg/cesium-dev/qMKvqBUGsoE/7w05FYUtBwAJ.
The issue https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/16 was closed because we decided that the tileset and style should be separate concepts. In Cesium you would load the tileset first and then set tileset.style = new Cesium3DTileStyle(path_or_json_object). Or if you don’t want to write a style with JSON, you can operate directly on the features of a tile. Batched3DModel3DTileContent and other tile formats have a getFeature function that returns the feature with the given batch id. From there you can change its color. This is definitely preferable to using model.color, which would change the color for the entire tile instead of the individual feature.
Sorry there isn’t a simpler answer for the batch ids.
Thanks for the information. I'm not aware of a specific open source package to "batch" buildings into tiles, but I managed to batch-convert each individual glb's of the buildings into the .b3dm counter part (using glbtob3dm). And that's where I got stuck.
I checked out the thread you pointed to, and it doesn't seem like I can do the job without investing some fair amount of time-- or money. That function <modifyGltfWithBatchIds> looks promising, though.