Load in multiple .fbx files to one asset

Hello,

I am trying to make a model that shows different buildings highlighted by different properties that they have in common. So for example, all buildings with the same postal code would light up red when a checkbox is clicked. Then when another postal code is selected and both checkboxes are checked, all buildings with those two postal codes will be red. I have figured out how to do this using the Cesium OSM Building file but now I want to load in my own buildings formatted as an .fbx file. Each building is a separate .fbx file so I realized while loading these in I could not just utilize:

osmBuildingsTileset.style = new Cesium.Cesium3DTileStyle({
color: {
conditions: [
["${feature[‘addr:postcode’]} === ‘60611’", “color(‘purple’)”],
],
},
});

Since these are all loaded separately, they are not all on one variable such as osmBuildingsTileset. Here is how I have loaded them in.

  var building1 = viewer.scene.primitives.add(
    new Cesium.Cesium3DTileset({
      url: Cesium.IonResource.fromAssetId(######)
    })
  );
    var building2 = viewer.scene.primitives.add(
    new Cesium.Cesium3DTileset({
      url: Cesium.IonResource.fromAssetId(######)
    })
  );
    var building3 = viewer.scene.primitives.add(
    new Cesium.Cesium3DTileset({
      url: Cesium.IonResource.fromAssetId(######)
    })
  );

Is there a way to import them in as separate assets on Cesium Ion so that I can adjust their individual tile location and then load them in as one variable with Cesium JS? Or would the best case to be to link each location to the file and then upload them all as one asset on Cesium Ion? Also if this was the case, how could I assign metadata for properties to each individual building if they are all in the same asset? And could I go back into Cesium Ion and add new .fbx files to the existing asset if I model more buildings?

Any advice would be greatly appreciated! Please ask me any clarifying questions as well as I know this is a long post.

Thank you,
Claire

Hi Claire,

This other post has a similar question – could you try the suggestion in the thread and let me know how it goes?

Hi @janine,

Thank you for that link! So in the solution they mention loading each file in at once in the Cesium Ion. The thing is, I will have more files to add to the asset over time. So far, I could not find a way to edit the asset in the Cesium Ion to add a new .fbx file once it was already created. If I could do this, then I would just upload the entire block of buildings together in Ion, but without this, I am looking for a way to code them so that they are linked together in one variable name with Cesium JS.

If you have any information on being able to edit an asset once its made to add new files to it, they would be greatly appreciated.

Thanks,
Claire

Hi Claire,

Ah, I understand what you’re trying to do now. Unfortunately, I don’t believe you can add new models / files to an existing asset, so if you add more buildings, you will have to redo the upload to Cesium ion. It’s also not possible to merge them into a single asset or variable name in code. You could put them all in an array, but I know that’s not exactly what you want.

I could add this in as a feature request / enhancement for Cesium ion, and the team can look at it when they have the bandwidth. Otherwise, let me know if you have any other questions I can help with!

Best of luck,
Janine