iOS SceneKit:XCode "breaks" 导入 DAE material 颜色

iOS SceneKit: XCode "breaks" imported DAE material colors

首先,如果关于 3D 设计的非技术性语言超出了我的范围,我深表歉意。 我正在使用一些 DAE 文件在 SceneKit 上显示 3D 模型,由 3D 设计师提供。但是,当我将它添加到 XCode 上的 scnassets 文件夹时,所有 material 颜色都会“损坏”。以珠宝的这个 DAE 为例,蓝色和白色版本在在线查看器上可视化并且是正确的。另一张黑白照片是我从 phone 运行 一个 ARSession 中截取的截图,其中 dae 已加载到节点上。

关于如何保留原始颜色的任何想法?

Update 运行 从命令行我收到很多这样的警告:

$ xcrun scntool --convert ARO-E-BLING.DAE --output cliConverted.scn --format scn

Warning: The instance_effect with URL file:/Users/Leandro/Documents/ARO-E-BLING.DAE#White stone-fx does not reference an effect, skipping it

Warning: The instance_effect with URL file:/Users/Leandro/Documents/ARO-E-BLING.DAE#Blue Stone-fx does not reference an effect, skipping it

Warning: Found an invalid material [White], reverting to a default material

Warning: Found an invalid material [Blue], reverting to a default material

好吧,运行 它从命令行帮助我找到了解决方案。如果 dae 中的材料 and/or 效果有空格,似乎 scntool 会失败。例如我有这样的东西:

<material id="Blue Stone" name="Blue Stone">
  <instance_effect url="#Blue Stone-fx"/>
</material>

我不得不更换为

<material id="Blue_Stone" name="Blue_Stone">
  <instance_effect url="#Blue_Stone-fx"/>
</material>

2018 年 1 月 8 日更新 我向 Apple 提交了错误报告,他们表示此行为不是错误,说明:

According to the Collada spec (https://www.khronos.org/files/collada_spec_1_4.pdf) the URL of an "instance_effect" is of type "xs:anyURI".

URIs are not allowed to contain space, they must be escaped ("Spaces should instead be escaped using %20" in http://www.datypic.com/sc/xsd/t-xsd_anyURI.html).