Create SdfLayer/UsdScene from StringLiteral

Hi there, is there any way for us to create a SdfLayer or Usd Scene simply from String or Bytestream? From what I have known so far, it seems we can only provide a file path to create a sdfLayer then opened as a scene. But I would like a way to create a scene from raw string(not in the File System), access it, modify the prim’s data, and write it back to a katana node, Any Idea?

Hey StanDou,

So this depends on what version of Katana you’re using; there may be other ways to achieve the results you’re looking for… However, to answer your initial question, to write a string (USDA formatted I’m presuming?) to a SdfLayer, you can use:
ImportFromString on the SdfLayer itself.

I’d also suggest emailing the Katana Support team if you had further Katana specific questions, or asking in the community forums (you’ll likely get a more Katana specific response!).

Universal Scene Description: SdfLayer Class Reference

Thanks James! That’s very helpful to me!