Can't access GLTF/GLB submesh nor material info when using (archived) Sceneform 1.16.0

Viewed 226

Under Sceneform 1.16.0 is not possible to access to submeshes nor materials info present in a GLTF/GLB file, as their count is always zero.

Regarding that this is now an open-source (and archived-abandoned) project by Google, it's possible to inspect the code of Renderable class in order to try to locate where the problem is generated.

This brings us to the constructor:

@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();
}

...where the original Renderable (other) has zero submeshes (other.renderableData) and materials (other.materialBindings).

Any help with this?

Best regards.

0 Answers
Related