Merging tilesets?

I have converted a model from context capture to 3Dtiles, but the produced model contains hundreds of .json files and even more .b3dm files!!!! The model is just one building and it would take me a day to import all these files in my application. Let alone that I would like to convert some more buildings the same way... Can I merge them somehow? Or should I change any settings in CC?
I would appreciate any kind of ideas!
Thank you in advance :slight_smile:

It’s hard to tell without seeing the asset data, but generally having a lot of small files is better than one big file (that way you can stream in only the areas you need).

What application are you importing your 3D Tiles in? If you haven’t already tried it, we recently launched Cesium ion (http://cesium.com/ion) that lets you tile and host your data, which might be more convenient depending on what you’re trying to do.

Oh, and in ion you could upload all your buildings and get just one tileset and it’ll automatically optimize it for streaming.

Hi Omar
I tried to upload the files on cesium Ion but I get a message that it doesn’t support the file types! I am building an app by using Cesium API of 3d model for my master thesis, so I am basically using this part of code to upload the files...
var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
     url : ‘http://localhost:8002/tilesets/Seattle/tileset.json
}));

That means that I should copy this part of code more than 600 times and addresse it to different files! Is there any other way that I miss?

What type of file have you tried to upload to ion?

If you upload your original 3d model (not as a 3D Tiles, but the original geometry as an OBJ or other formats that ion supports), you should be able to get a single URL that will load all of your data.

Let me know if that works.

It is a photomesh model created in ContextCapture! Context Capture allows cesium 3d tiles export and produces .json and .b3dm files!
So why should I convert it to something else? Either way I think that If I convert it to obj the model will lose its texture!
To be honest I think that I need a part of code that allows reading all .json files in a directory, but I haven’t found anything yet! I tried something like
var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
     url : ‘http://localhost:8002/tilesets/Seattle/*.json
}));
but it doesn’t work!

It is a photomesh model created in ContextCapture! Context Capture allows cesium 3d tiles export and produces .json and .b3dm files!
So why should I convert it to something else?

Because it exports too many independent files. If there’s no option in Context Capture to export one merged tileset, then I would try tiling your data with ion. It should be able to support OBJs with textures if Context Capture exports it correctly.

Eventually we’d like to have a way to re-tile tilesets, so you could just upload all your *.json files and ion will give you back one merged tileset, but that’s not something we ave yet.

Either way I think that If I convert it to obj the model will lose its texture!
To be honest I think that I need a part of code that allows reading all .json files in a directory, but I haven’t found anything yet! I tried something like
var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
url : ‘http://localhost:8002/tilesets/Seattle/*.json
}));
but it doesn’t work!

Web server requests don’t work that way. Unless the server explicitly it, I don’t think you can crawl a directory for all the files like that.

If they are named consistently (like 0.json, 1.json etc.) you might just need to write a for loop.

Good idea! I will try that too and I will check the ContextCapture settings if it is able to merge them during export! Then if non of them works, I will turn to the obj option!
Thank you very much for your time!