Layer::ExportToString produces corrupt USDA string in memory

I am trying to use the in memory export to USDA SdfLayer::ExportToString, but for nearly every hierarchy encountered it generates a corrupted USDA string with malformed vertices/indices. Here is a simple gummy bear for example. The usd is on the left and the usda is on the right.

Thanks in advance!

Hi @evanburkert

Can you share what version of OpenUSD and platform you’re on? I recall there was some issue with USDA writing on certain platform/locales generating bad indices.

This is the issue USDA Writes Sensitive to User’s Locale · Issue #3214 · PixarAnimationStudios/OpenUSD

which was fixed with this change
Specialized TfStringify for integral types to prevent locale dependent writes by erslavin · Pull Request #3222 · PixarAnimationStudios/OpenUSD.

So the issue I’m thinking of should be fixed if you’re on a 25.xx version of OpenUSD.

Thank you! I believe we are still on 23.11 but will be switching to 25.xx very soon. This is good to know and I’ll reply back once we are fully migrated.

Cheers!:grinning_face: