# Difference between Added and Appended references

**URL:** <https://forum.aousd.org/t/difference-between-added-and-appended-references/824>\
**Category:** USD\
**Created:** [October 19, 2023, 4:49am UTC](https://forum.aousd.org/t/difference-between-added-and-appended-references/824 "2023-10-19T04:49:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PhilS](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@PhilS](https://forum.aousd.org/u/PhilS)\
**Post date:** [October 19, 2023, 4:49am UTC](https://forum.aousd.org/t/difference-between-added-and-appended-references/824/1 "2023-10-19T04:49:36Z")

</div>

Traversing primspecs to find references I noticed there is a distinction between “added” and “appended” references.

i.e. in python Im getting a referenceList result like:

```auto
{ 
'added': [],
'prepended': [
    SdfReference(my_id1.usd, /cone_geo, SdfLayerOffset(0, 1), {}), 
    SdfReference(my_id2.usd, /cylinder_geo, SdfLayerOffset(0, 1), {})
],
'appended': [], 
'deleted': [], 
'ordered': [] 
}

```

I cant see much distinction in the docs between “add” and “append” - is there anything I should watch out for there? (Indeed I cant see any method that looks like an “appendReference”)

Also interesting is that I constructed this example using only the `Prim.GetReferences().AddReference()` method, yet these are described as prepended references. Is _that_ something I should be concerned about?

Appreciate any clarity!  
Phil

---

<div class="post-metadata">

**Author:** ![spiff](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/spiff/32/22_2.png) [@spiff](https://forum.aousd.org/u/spiff)\
**Post date:** [October 19, 2023, 9:00pm UTC](https://forum.aousd.org/t/difference-between-added-and-appended-references/824/2 "2023-10-19T21:00:46Z")

</div>

Hi @PhilS,  
`added` is considered deprecated, and the UsdPrim-based API’s will not ever create “added” entries for you. `added` listOps have some complicated ordering behavior to them that was originally deemed useful in Presto, but prevent lossless “flattening” of layerStacks. About six years ago we rethought how listOps could work, and replaced the add & reorder (the `ordered` field in your above example) with append and prepend. Add and Reorder are still there in Sdf only because we have yet to update Presto’s API’s to use them, or updated the many many Presto assets that use them.

We decided not to change the UsdReferences (et al) method names, and instead [added a `position` argument](https://openusd.org/release/api/class_usd_references.html#a95bf456b23a234d3aa017015a4ad05e0) that lets you specify whether you want appending or prepending.

---

<div class="post-metadata">

**Author:** ![PhilS](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@PhilS](https://forum.aousd.org/u/PhilS)\
**Post date:** [October 20, 2023, 12:51am UTC](https://forum.aousd.org/t/difference-between-added-and-appended-references/824/3 "2023-10-20T00:51:30Z")

</div>

Thanks for clearing that up @spiff!
