Is there a way to add a reference to a prim either using USDRT or asynchronously? The current method (see below) sometimes freezes the app for about a half a second. It is not terrible, but I am hoping there is a way to load the new reference without that visible lag.
// Here, prim is a Usd.Prim
prim.GetReferences().ClearReferences()
prim.GetReferences().AddReference('path/to/usd.usd')
According to the documentation (USD, Fabric, and USDRT — usdrt 7.5.1 documentation), Fabric/USDRT cannot be used to add a reference.
Is there a way to load the referenced USD asynchronously before assigning it to the prim as a reference?
Turning on Fabric Scene Delegate in the Rendering section of Preferences helped with the loading times. However, for a split second, there is an empty space. I assume it is because of the time in between ClearReferences and AddReference. I tried using the SetReferences method instead, but obtained the same results.
I am sorry to hear that you are having some issues. Let me try to ask if there is a better way of doing this.
I am glad to hear that turning of FSD helps. I am not sure what we can do with the remaining “split second” of empty space. It may just be the limitation of the code at this time.
Appreciate the input, Richard. Currently, I put a delay in between the addition and removal of the old reference (to avoid the empty space). It seems to be a decent workaround.
Since what I’m doing requires this to occur periodically, it would be great if there was an asynchronous way of doing this. The loading of the reference doesn’t have to be immediate, but it would help the experience to eliminate the sudden lag spikes.
Thanks again.