aframearchilogic3d.io

get storageKey from a sceneId


I am trying to use the 3d.io API on a Node.js server to export a scene as a blender model. I have the sceneId for the scene, however the export API seems to only want a storageKey and I'm not sure how to get one from a sceneId. I have found issues that resolve this for the in-browser case, but not the server-side case.


Solution

  • you can export a scene when it is light-baked in the editor ( it is by default when converted from a floor plan ) In that case, a static geometry is linked to the model that can be exported The scene structure's level nodes have a bakedModelUrl property

    const io3d = require('3dio')
    
    io3d.scene.getStructure('62cb3510-6708-4f62-94c3-f9936db7e20b')
      .then(result => {
        // level node is 2nd hierarchy - below plan node
        const level = result.children.find(el => el.type === 'level')
        const storageKey = level.bakedModelUrl
        console.log(storageKey)
      })
      .catch(err => {
      })