首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从Url获取storageId

从Url获取storageId
EN

Stack Overflow用户
提问于 2018-02-16 00:23:48
回答 1查看 66关注 0票数 3

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

代码语言:javascript
复制
io3d.storage.getIdFromUrl('https://spaces.archilogic.com/3d/Home_2766/grrodvuu?modelResourceId=cd36dc78-a124-4a4e-9990-35be32415f84')
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-02-16 00:51:43

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

在这种情况下,您可以使用场景API查找具有bakedModelUrl的子对象,该use是模型的存储ID:

代码语言:javascript
复制
// 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)
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48811840

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档