Getting empty string when trying to get resolvedPath of UDIM path

Title says it all, I have a usda file like UsdUVTexture like:

def Shader "bla"
{
     uniform token info:id = "UsdUVTexture"
     asset inputs:file = @udimsfolder/udim_texture_<UDIM>.jpg@
     ....
}

and somewhere in my code i do:

file_attr = usd_texture.GetInput('file')
if file_attr:
     file_path = file_attr.Get().resolvedPath
     texture.filename = file_path
     ....

and no matter if the UDIM path is relative or absolute, I always get an empty string returned by the “.resolvedPath” call. I searched around the archives to see if others came across similar issues and there seem to have been but not quite the same. Is the behavior I am seeing expected/normal?

Hi @Quaxo , welcome to the forum.
Unfortunately, the UDIM resolution is left up to the renderer.

USD itself doesn’t have a UDIM resolver so the empty string is due to failed resolution.

If you’re trying to resolve this without a renderer doing it for you, the easiest method is probably querying the raw string and substituting the UDIM token yourself, then asking usd to resolve that.

That’s right, and USD will do “the best it can”, i.e. if the authored path is an “anchored path” like
@./udimsfolder/udim_texture_.jpg@ , the returned SdfAssetPath that the UsdAttribute gives you will have already performed the anchoring to the layer’s location for you, so you will get back a different and more complete string than the one that was authored, but the “” will still be there for you to resolve yourself.