使用(已存档)Sceneform 1.16.0 时无法访问 GLTF/GLB 子网格或材质信息

2023-12-20

Under 场景形式 1.16.0无法访问 GLTF/GLB 文件中存在的子网格或材质信息,因为它们的计数始终为零。

鉴于此现在是 Google 的开源(且已存档废弃)项目,因此可以检查 Renderable 类的代码,以尝试定位问题产生的位置。

这给我们带来了构造函数:

@SuppressWarnings("initialization")
  protected Renderable(Renderable other) {
    if (other.getId().isEmpty()) {
      throw new AssertionError("Cannot copy uninitialized Renderable.");
    }

    // Share renderableData with the original Renderable.
    renderableData = other.renderableData;

    // Copy materials.
    Preconditions.checkState(other.materialNames.size() == other.materialBindings.size());
    for (int i = 0; i < other.materialBindings.size(); i++) {
      Material otherMaterial = other.materialBindings.get(i);
      materialBindings.add(otherMaterial.makeCopy());
      materialNames.add(other.materialNames.get(i));
    }

    renderPriority = other.renderPriority;
    isShadowCaster = other.isShadowCaster;
    isShadowReceiver = other.isShadowReceiver;

    // Copy collision shape.
    if (other.collisionShape != null) {
      collisionShape = other.collisionShape.makeCopy();
    }

    changeId.update();
}

...原始可渲染 (other) 具有零个子网格 (other.renderableData) 和材质 (other.materialBindings)。

有什么帮助吗?

此致。


None

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用(已存档)Sceneform 1.16.0 时无法访问 GLTF/GLB 子网格或材质信息 的相关文章

随机推荐