Live Layer Data¶
OmniUsdObjectData implements SdfAbstractData which is how USD reads/writes layer data.
The object data contains 2 copies of the tree:
Current Tree: This is the tree as the local USD library sees it.
Base Tree: This is the tree as-of the latest update from the server.
Apply the update to the “base tree”
Save the “current tree” as “old tree”
Reset the “current tree” to “base tree”
Re-apply any unacknowledged structural changes to “current tree”
Diff the “current tree” against the “old tree” to generate notices.
Apply reorder commands to child list fields and generate notices.
Apply field & timesample updates and generate notices. Remember, we ignore field & timesample changes if we have an unacknowledged change to the same field.
Steps 1-6 are skipped if the update doesn’t contain any structural changes.
We can receive updates out of order, so we store received updates in a queue and only process them in sequence. There should be no gaps, so if our current sequence number is 12, we will not process anything until we receive sequence number 13.
Receiving updates prior to “OkLatest” also skips a lot of steps, because we know that there cannot be any local changes, and we also don’t generate notices because USD doesn’t consider the layer to have been loaded yet.
If there are more than 16 unacknowledged updates, we will stop sending any more updates until we have less than 8 unacknowledged updates. This is to prevent flooding the server with updates faster than it can process them.