【问题标题】:Getting the storageId from Url从 Url 获取 storageId
【发布时间】:2018-07-26 11:33:12
【问题描述】:
有人知道如何通过 3d 模型获得 storageID 吗?似乎有这样的方法,但它一直告诉我无效的网址。谢谢!
io3d.storage.getIdFromUrl('https://spaces.archilogic.com/3d/Home_2766/grrodvuu?modelResourceId=cd36dc78-a124-4a4e-9990-35be32415f84')
【问题讨论】:
标签:
aframe
archilogic
3d.io
【解决方案1】:
我假设您正在寻找整个烘焙模型的存储 ID?
在这种情况下,您可以使用场景 API 找到具有模型存储 ID bakedModelUrl 的子节点:
// 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)