syoyo / tinyusdz

Tiny, dependency-free USDZ/USDA/USDC library written in C++14
Other
453 stars 32 forks source link

Support GeomModelAPI, or skip unrecognized API #170

Open MootoolsSoftware opened 2 weeks ago

MootoolsSoftware commented 2 weeks ago

The following model https://dpel-assets.aswf.io/4004-moore-lane/intel_moorelane_v1_2_0.zip contains some USD file that fails due to unsupported API.

ERR : [error]D:\Manu\Dev_Release\Contrib\tinyusdz\src\usdc-reader.cc:ReconstructStage():3438 Failed to reconstruct Stage(Prim hierarchy) ReconstructPrimNode():2350 Failed to parse Prim fields. [error]D:\Manu\Dev_Release\Contrib\tinyusdz\src\usdc-reader.cc[USDC]:ParsePrimSpec():1919 Failed to validate apiSchemas: Invalid or Unsupported API schema: GeomModelAPI

ERR : [error]D:\Manu\Dev_Release\Contrib\tinyusdz\src\usdc-reader.cc:ReconstructStage():3438 Failed to reconstruct Stage(Prim hierarchy) [error]D:\Manu\Dev_Release\Contrib\tinyusdz\src\usdc-reader.cc[USDC]:ReconstructPrimNode():2350 Failed to parse Prim fields. [error]D:\Manu\Dev_Release\Contrib\tinyusdz\src\usdc-reader.cc[USDC]:ParsePrimSpec():1919 Failed to validate apiSchemas: Invalid or Unsupported API schema: ShadowAPI

I wonder if this prim could not be skipped in order to retain the recognized one's. 3dsMax shows the following:

4004MooreLane_III_03_ASWF

syoyo commented 2 weeks ago

There is a flag to skip unknown apiSchema token,

https://github.com/syoyo/tinyusdz/blob/7f3ae22884cfa8e1834f1750c30c807f0df466c6/src/usda-reader.hh#L19

but this flag is not used in actual downstream tasks(USDA parser, USDC parser, etc.) at the moment. Also we need to add this flag to USDLoadOptions.

https://github.com/syoyo/tinyusdz/blob/7f3ae22884cfa8e1834f1750c30c807f0df466c6/src/tinyusdz.hh#L53

For a while, reporting unknown apiSchema as error always is good to find a potential USD error(e.g. we are better to report apiSchema token with wrong spelling(for example 'skekeBindAPI').

I'm planning to add ShadowAPI and 'GeomModelAPI` as a known apiSchema in the near future.