# UsdUtils.ExtractExternalReferences converts \<udim\> to 1001 in 23.11

**URL:** <https://forum.aousd.org/t/usdutils-extractexternalreferences-converts-udim-to-1001-in-23-11/1669>\
**Category:** USD\
**Tags:** python\
**Created:** [July 9, 2024, 2:32am UTC](https://forum.aousd.org/t/usdutils-extractexternalreferences-converts-udim-to-1001-in-23-11/1669 "2024-07-09T02:32:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pawel-fin](https://avatars.discourse-cdn.com/v4/letter/p/51bf81/32.png) [@pawel-fin](https://forum.aousd.org/u/pawel-fin)\
**Post date:** [July 9, 2024, 2:32am UTC](https://forum.aousd.org/t/usdutils-extractexternalreferences-converts-udim-to-1001-in-23-11/1669/1 "2024-07-09T02:32:28Z")

</div>

Hi,  
we are in the process of updating USD from 23.02 to 23.11 and noticed a change in the returned paths.

we have a simple test USD that points to a texture using `<udim>` tag in the path

```auto
#usda 1.0
(
    upAxis = "Y"
)

def Scope "mtl"
{
    def Material "material"
    {
        token outputs:surface.connect = </mtl/material/PBRShader.outputs:surface>

        def Shader "PBRShader"
        {
            uniform token info:id = "arnold:standard_surface"
            color3f inputs:base_color.connect = </mtl/material/diffuseTexture.outputs:rgb>
            token outputs:surface
        }

        def Shader "diffuseTexture"
        {
            uniform token info:id = "arnold:image"
            asset inputs:filename = @C:/CODE/pyCharm/pipeline/fin_unittest/TEST_PROJECT_0/_Temp/Creatures/gorilla-tex/lookDev/texture/texture/0001/gorilla-tex_lookDev_texture_v0001_base_colour.<UDIM>.exr@
            color3f outputs:rgb
        }
    }
}

```

when we query the dependencies of this file using `UsdUtils.ExtractExternalReferences`  
we get the exact same path as in the USD file from `23.02`. However, `23.11` returns it as: `gorilla-tex_lookDev_texture_v0001_base_colour.1001.exr'`

`23.02` → `gorilla-tex_lookDev_texture_v0001_base_colour.<UDIM>.exr`  
`23.11` → `gorilla-tex_lookDev_texture_v0001_base_colour.1001.exr`

this may have unforeseen implications in our pipeline and I wanted to check if this is the desired outcome and what the thinking behind it is. From the current API we don’t know if this is a single texture or a sequence (maybe the artist wants to have the same texture on all udims etc?)

---

<div class="post-metadata">

**Author:** ![pawel-fin](https://avatars.discourse-cdn.com/v4/letter/p/51bf81/32.png) [@pawel-fin](https://forum.aousd.org/u/pawel-fin)\
**Post date:** [July 17, 2024, 12:20am UTC](https://forum.aousd.org/t/usdutils-extractexternalreferences-converts-udim-to-1001-in-23-11/1669/2 "2024-07-17T00:20:28Z")

</div>

does anyone know if there is any other way to access the path as stored in the USD file?

---

<div class="post-metadata">

**Author:** ![BigRoyNL](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/bigroynl/32/413_2.png) [@BigRoyNL](https://forum.aousd.org/u/BigRoyNL)\
**Post date:** [July 17, 2024, 7:53pm UTC](https://forum.aousd.org/t/usdutils-extractexternalreferences-converts-udim-to-1001-in-23-11/1669/3 "2024-07-17T19:53:31Z")

</div>

You could iterate all AttributeSpecs (or properties) in the `Sdf.Layer` and if it is an `assetPath` then do something with it.

```python
def get_layer_property_paths(layer: Sdf.Layer) -> List[Sdf.Path]:
    """Return all property paths from a layer"""
    paths = []

    def collect_paths(path):
        if not path.IsPropertyPath():
            return
        paths.append(path)

    layer.Traverse("/", collect_paths)

    return paths

```

And then consider the spec only if it’s of type `asset`?  
An example of something like that is [here](https://github.com/ynput/ayon-houdini/blob/ed2a8018350c0c19ad6b63af9180abf73a919f43/client/ayon_houdini/plugins/publish/collect_usd_look_assets.py#L140-L170) also using the above function in that code.

Does that help? Or are you looking to do this for a composed USD stage and not the raw layers?

---

<div class="post-metadata">

**Author:** ![mlarocca](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@mlarocca](https://forum.aousd.org/u/mlarocca)\
**Post date:** [July 17, 2024, 8:09pm UTC](https://forum.aousd.org/t/usdutils-extractexternalreferences-converts-udim-to-1001-in-23-11/1669/4 "2024-07-17T20:09:25Z")

</div>

Hello Pawel,

Thank you for pointing this out. We did some refactoring of the underlying system that backs a number of the `UsdUtils` functions and it looks like udim functionality for `UsdUtils.ExtractExternalReferences` slipped through the cracks. Would you mind creating an issue on github for this?

Thanks!

---

<div class="post-metadata">

**Author:** ![pawel-fin](https://avatars.discourse-cdn.com/v4/letter/p/51bf81/32.png) [@pawel-fin](https://forum.aousd.org/u/pawel-fin)\
**Post date:** [July 18, 2024, 11:43pm UTC](https://forum.aousd.org/t/usdutils-extractexternalreferences-converts-udim-to-1001-in-23-11/1669/5 "2024-07-18T23:43:39Z")

</div>

thank you @BigRoyNL I will experiment with the properties.  
@mlarocca of course I can make github bug report. thank you for looking into it!

---

<div class="post-metadata">

**Author:** ![pawel-fin](https://avatars.discourse-cdn.com/v4/letter/p/51bf81/32.png) [@pawel-fin](https://forum.aousd.org/u/pawel-fin)\
**Post date:** [July 18, 2024, 11:53pm UTC](https://forum.aousd.org/t/usdutils-extractexternalreferences-converts-udim-to-1001-in-23-11/1669/6 "2024-07-18T23:53:01Z")

</div>

> <https://github.com/PixarAnimationStudios/OpenUSD/issues/3173>
>
> \### Description of Issue
> 
> The paths returned by UsdUtils.ExtractExternalRefere…nces no longer contain \`\<udim\>\` tag in 23.11
> 
> 23.02 → gorilla-tex\_lookDev\_texture\_v0001\_base\_colour.\<UDIM\>.exr
> 23.11 → gorilla-tex\_lookDev\_texture\_v0001\_base\_colour.1001.exr
> 
> \### Steps to Reproduce
> 
> given the simple USD file as below:
> \`\`\`
> \#usda 1.0
> (
> upAxis = "Y"
> )
> 
> def Scope "mtl"
> {
> def Material "material"
> {
> token outputs:surface.connect = \</mtl/material/PBRShader.outputs:surface\>
> 
> def Shader "PBRShader"
> {
> uniform token info:id = "arnold:standard\_surface"
> color3f inputs:base\_color.connect = \</mtl/material/diffuseTexture.outputs:rgb\>
> token outputs:surface
> }
> 
> def Shader "diffuseTexture"
> {
> uniform token info:id = "arnold:image"
> asset inputs:filename = @C:/CODE/pyCharm/pipeline/fin\_unittest/TEST\_PROJECT\_0/\_Temp/Creatures/gorilla-tex/lookDev/texture/texture/0001/gorilla-tex\_lookDev\_texture\_v0001\_base\_colour.\<UDIM\>.exr@
> color3f outputs:rgb
> }
> }
> }
> \`\`\`
> execute \`UsdUtils.ExtractExternalReferences\` for it.
> in the 23.11 the path returned doesn't match what is stored in the file and is returned as \`1001\` udim. In the previous versions, the \`\<udim\>\` tag was preserved by the utility.
> 
> \### System Information (OS, Hardware)
> 
> windows 10,
> USD 23.11
> 
> \### Package Versions
> 
> \### Build Flags
