Assigning API Schemas using SDF PrimSpec

In Python, I’ve been constructing layers using the SDF API following this guide. When creating Primitives using SDF, we can change the primitive info with the “SetInfo” call. However, the documentation advises against using it.

So I wanted to ask what’s the recommended path to set info like prepending API Schemas through the Python SDF library or if it’s advised to instead use a USD prim for that.


Hi @jul - thanks for asking! In this case, because apiSchemas is defined by the usd module, which sits above sdf, there is no builtin API on SdfPrimSpec, so SetInfo is the way to go. You can find examples of manipulating it on primSpecs in

1 Like

For anyone else lazy on that provided link - I believe this was the intended code area that does the Sdf access with GetInfo and SetInfo for the schemas.

1 Like

Oops - thanks for the fix, @BigRoyNL !