syoyo / tinyusdz

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

No geom returned by tydra::ListPrims #169

Closed MootoolsSoftware closed 2 weeks ago

MootoolsSoftware commented 2 weeks ago

Crayon.zip

No geom is accessible from the following file using the following code:

    std::string warn;
    std::string err;

    tinyusdz::Stage stage;
    tinyusdz::USDZAsset usdz_asset;
    tinyusdz::AssetResolutionResolver arr;
    tinyusdz::LoadUSDFromFile("Crayon.geom.usd", &stage, &warn, &err);

    MeshMap meshmap;
    tinyusdz::tydra::ListPrims(stage, meshmap);
    // Parse all geoms
    for (const auto& item : meshmap) // meshmap is empty
    {
       ...

In 3ds max, the import give the following result: pencil

syoyo commented 2 weeks ago

Crayon's geom is composed of Variants.

Variant is not well supported in USDC parser and Tydra API at the moment.

FYI,you'll get the following warning in tusdcat

$ tusdcat Crayon.geom.usd
...
WARN : [warn]/home/syoyo/work/tinyusdz/src/usdc-reader.cc:AddVariantChildrenToPrimNode():383 Multiple Field with VariantSet SpecType detected.