Here is a small snippet of what I am doing.
assets = ["foo", "baa"] sop_paths = ["/stage/primitives/my_foo", "/stage/primitives/my_baa"] base_prim = stage.DefinePrim('/base_prim', 'Xform') for i in range(len(assets)): base_prim.GetPrim().GetReferences().AddReferences(sop_paths[i])
I can see when I use a sop_import_lop and inspect the stage the references(payloads) are using the op: syntax
@op:/stage/primitives/my_foo.sop:SDF_FORMAT_ARGS:globalauthortimesamples=0&pathprefix=/sopimport1&t=7.125@
I have tried some string formatting to match the above, but it feels very ugly and potentially dangerous.
"op:{}.sop:SDF_FORMAT_ARGS:globalauthortimesamples=0&pathprefix=/sopimport1&t=7.125".format(sop_paths[i])
The reasoning behind doing this programatically, is it will feed into some much larger import logic including variants/purpose, and is currently pure python API.
Cheers,
Aaron.