1

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.

Sam Johnson
  • 624
  • 1
  • 7
  • 20

1 Answers1

0

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 => {
  })
Frederic
  • 326
  • 1
  • 5
  • So to be clear then, without using server side browser emulation it is impossible to do this server side as the getStructure function is client-side only? In that case we will probably use headless chrome server side with the approach you mentioned. – Sam Johnson Jun 20 '18 at 15:52
  • io3d.scene.getStructure works server side without problems. what node version / 3dio version are you using? – Frederic Jun 21 '18 at 09:36
  • light-baking a scene is currently only possible in the frontend – Frederic Jun 21 '18 at 09:37