adobe / USD-Fileformat-plugins

A collection of USD fileformat plugins
298 stars 22 forks source link

Converting PointInstancedMedCity.usd produces an invalid glTF #1

Closed weegeekps closed 5 months ago

weegeekps commented 6 months ago

Expected Behaviour

A valid glTF file using mesh instancing is generated.

Actual Behaviour

An invalid glTF file is generated.

According to the glTF Validator, there are 16,384 errors. Almost all of them are of the type ACCESSOR_VECTOR3_NON_UNIT with similar messaging as the sample below:

{
    "code": "ACCESSOR_VECTOR3_NON_UNIT",
    "message": "Vector3 at accessor indices 8982..8984 is not of unit length: 2.5786273950965986e-40.",
    "severity": 0,
    "pointer": "/meshes/0/primitives/0/attributes/NORMAL"
},

Attempting to open this file using Blender results in crashing, and attempting to perform introspection into the file using glTF Transform results in segmentation faults.

Reproduce Scenario (including but not limited to)

Attempting to convert this file in any scenario appears to be problematic.

Steps to Reproduce

  1. Download PointInstancedMedCity.usd from https://openusd.org/release/dl_downloads.html
  2. Use the sample code below to convert PointInstancedMedCity.usd to glTF
  3. Test in the glTF Validator

Platform and Version

Ubuntu 22.04 with USD 23.11

Sample Code that illustrates the problem

from pxr import Usd

stage = Usd.Stage.Open("PointInstancedMedCity.usd")
stage.Export("PointInstancedMedCity.glb")

Logs taken while reproducing problem

Warning: in readMeshData at line 351 of /home/amorris/Projects/USD-Fileformat-plugins/utils/layerRead.cpp -- No texture coordinates for mesh /MediterraneanHills/Buildings/Prototypes/prototype_0/mesh_0
Warning: in readMeshData at line 351 of /home/amorris/Projects/USD-Fileformat-plugins/utils/layerRead.cpp -- No texture coordinates for mesh /MediterraneanHills/Buildings/Prototypes/prototype_1/mesh_0
Warning: in readMeshData at line 351 of /home/amorris/Projects/USD-Fileformat-plugins/utils/layerRead.cpp -- No texture coordinates for mesh /MediterraneanHills/Buildings/Prototypes/prototype_2/mesh_0
Warning: in readMeshData at line 351 of /home/amorris/Projects/USD-Fileformat-plugins/utils/layerRead.cpp -- No texture coordinates for mesh /MediterraneanHills/Buildings/Prototypes/prototype_3/mesh_0
kwblackstone commented 5 months ago

Thanks for the report this should be fixed with version 1.0.2. Please reopen if the issue persists for you.