Loading references via python

   440   1   1
User Avatar
Member
21 posts
Joined:
Offline
Good day community

How I could load references via python LOP without inlineusd LOP ?

I want to recreate via python that USD description

def "sphere" (
prepend references = @../../home/user/sphere.usd@
)
{
}
User Avatar
Member
249 posts
Joined: Oct. 2014
Offline
Assuming you have a prim that already exists, and you want to add a reference to that prim, I would try:

# get the existing references (there may be none)
references = prim.GetReferences()

# add your new one
references.AddReference(assetPath, primPath)


Example from Nvidia Omniverse:
https://docs.omniverse.nvidia.com/dev-guide/latest/programmer_ref/usd/references-payloads/add-reference.html [docs.omniverse.nvidia.com]
- Tim Crowson
Technical/CG Supervisor
  • Quick Links