syoyo / tinyusdz

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

Confusion about USDLoadOptions #173

Closed MootoolsSoftware closed 2 weeks ago

MootoolsSoftware commented 2 weeks ago

TinyUSD dev branch, updated on June, 17 2024

USDLoadOptions provides different options for handling sublayers, references...

We are working on kitchen set but do not succeed to get access to the geometry. kitchen set seems to be handled correctly but we probably do not operate in the right way.

image

Here is the shot code we use:

tinyusdz::USDLoadOptions usdoptions;
usdoptions.do_composition = true;
usdoptions.load_references = true;
usdoptions.load_payloads = true;
usdoptions.load_sublayers = true;

tinyusdz::Stage stage;
tinyusdz::USDZAsset usdz_asset;
tinyusdz::AssetResolutionResolver arr;

bool ret = tinyusdz::LoadUSDFromFile(filename, &stage, &warn, &err, usdoptions);

MeshMap meshmap;
tinyusdz::tydra::ListPrims(stage, meshmap);

for (const auto& item : meshmap) // <- Mesh map is empty

So, how to get access to the kitchen set data? What is the proper way to achieve this? Should we use Stage?

Thanks!

syoyo commented 2 weeks ago

Composition is work-in-progress, and at least you should use LoadLayer(construct Layer/PrimSpec).

https://github.com/syoyo/tinyusdz/blob/7f3ae22884cfa8e1834f1750c30c807f0df466c6/examples/tusdcat/main.cc#L120

You can contribute to test with Kitchen set, investigate composition issues, and submit the fix(if the fix needed)

And I'm planning to deprecate composition flags in USDLoadOptions. These are added before implementing LoadLayer API.