adobe / adobe/USD-Fileformat-plugins

Importing a GLTF mesh with joint indices encoded as VEC4 results in an error

Open
#65 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
396
Forks
42
PR merge metrics
No merged PRs in 30d

Description

Many applications (incl Blender) write GLTF joint indices as `VEC4` but the `readAccessorInts` function used to read joint indices expects them to be encoded as `SCALAR`, which results in the following warning (and results in the joint indices not being read, and coming through to the USD stage as all zeroes):

```
Warning: in readAccessorInts at line 869 of USD-Fileformat-plugins\gltf\src\gltf.cpp -- Accessor 2 used as indices has invalid type 4 (expected SCALAR type 65). Rejecting to prevent type confusion attack.
```

**Repro Steps**

* Download the SimpleSkin GLTF example from: https://github.com/KhronosGroup/glTF-Sample-Models/tree/main/2.0/SimpleSkin/glTF
* Attempt to use the plug-in to read `SimpleSkin.gltf` into usdview
* Notice the above error is printed to the terminal
* Also notice that the resultant joint indices come through as zero in usdview:

Image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.