aframe - 从 Url 获取 storageId

标签 aframe archilogic 3d.io

有人知道如何从 3d 模型获取 storageID 吗?似乎有这样的方法,但它一直告诉我无效的网址。谢谢!

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

最佳答案

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

在这种情况下,您可以使用 Scene 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)

关于aframe - 从 Url 获取 storageId,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48811840/

相关文章:

javascript - 隐藏嵌入式框架场景

javascript - 在未连接 VR 耳机的情况下使用桌面时如何在 A-Frame 中显示分割 VR 模式

aframe - 在 : IO3D is not defined 中显示 aframe 结果

aframe - 获取模型的边界框或中心

augmented-reality - 如何将家具模型从 3d.io 导入 ARKit

archilogic - 如何通过存储 API 从我上传的 3d 模型中获取 .data3d.buffer

javascript - setAttribute 之后无法更新组件

aframe - Aframe 中的 Alpha 动画用于对象模型

archilogic - 3d.io 的航点动画问题

html - 如何通过家具库中的存储 API 上传数据 3D 模型