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 fixbrokenpixarschemas.py
For anyone else lazy on that provided link - I believe this
fixBrokenPixarSchemas.py was the intended code area that does the
Sdf access with
SetInfo for the schemas.
Oops - thanks for the fix, @BigRoyNL !