从URL获取存储ID



有人从3D模型中知道如何获得storageID?似乎有这样的方法,但它一直告诉我无效的URL。谢谢!

io3d.storage.getIdFromUrl('https://spaces.archilogic.com/3d/Home_2766/grrodvuu?modelResourceId=cd36dc78-a124-4a4e-9990-35be32415f84')

我假设您正在寻找整个烤制模型的存储ID?

在这种情况下,您可以使用场景API找到使用bakedModelUrl的孩子,这是模型的存储ID:

// this is the modelResourceId from the URL you gave in your question
io3d.scene.getStructure('cd36dc78-a124-4a4e-9990-35be32415f84')
  // we select the children
  .then(scene => scene.children)
  // find the child that has a bakedModelUrl
  .then(children => children.find(child => child.bakedModelUrl))
  // read the bakedModelUrl
  .then(level => level.bakedModelUrl)
  // and log it (or do whatever you need to do with it)
  .then(console.log)

相关内容

最新更新