[Solved] UDIMs concatenation error in USD Reference

   5817   9   1
User Avatar
Member
10 posts
Joined: Aug. 2013
Offline
Hi,

I was studying Solaris workshop, and I downloaded the assets from the documentation’s link
In my original Houdini file, I can see and render the UDIM files in LOPs,




but it does not appear when i load the USD reference file back




i tried jeff Wagner expression “from his workshop”:
$HIP/Textures/repacked_BarrelWithLid/repacked_BarrelWithLid_UV_%(UDIM)d_BaseColor.png
it does not appear when i load the USD reference file back.

i tried the documentation expression https://www.sidefx.com/docs/houdini/solaris/tutorial_1.html#matlib [www.sidefx.com]
$HIP/Textures/repacked_BarrelWithLid/repacked_BarrelWithLid_UV_<UDIM>_BaseColor.png
also it does not appear.

the only way makes it work, is to map the UDIM number itself “ 1001 ”
$HIP/Textures/repacked_BarrelWithLid/repacked_BarrelWithLid_UV_1001_BaseColor.png
then it will show up in the USD reference file, but definitely it will not read the other UDIM files.





I hope you can help me find the solution

Regards,
Hazem
Edited by Hazem Elshawaf - Sept. 12, 2020 12:34:16

Attachments:
1.png (2.2 MB)
2.png (2.2 MB)
3.png (427.3 KB)

User Avatar
Member
10 posts
Joined: Aug. 2013
Offline
here is the material USD which show gray shader

#usda 1.0
(
    metersPerUnit = 1
    upAxis = "Y"
)

def Scope "materials"
{
    def Material "Barrel"
    {
        token outputs:karma:displacement.connect = </materials/Barrel/Barrel1_displace.outputs:displacement>
        token outputs:karma:surface.connect = </materials/Barrel/Barrel1_surface.outputs:surface>
        token outputs:surface.connect = </materials/Barrel/Barrel1_preview.outputs:surface>

        def Shader "Barrel1_surface"
        {
            uniform token info:implementationSource = "sourceAsset"
            uniform asset info:sourceAsset = @opdef:/Vop/principledshader::2.0?SurfaceVexCode@
            vector3f inputs:basecolor = (1, 1, 1)
            asset inputs:basecolor_texture = "../Textures/repacked_BarrelWithLid/repacked_BarrelWithLid_UV_%(UDIM)d_BaseColor.png"
            int inputs:basecolor_useTexture = 1
            float inputs:metallic = 1
            float inputs:rough = 1
            token outputs:surface
        }

        def Shader "Barrel1_displace"
        {
            uniform token info:implementationSource = "sourceAsset"
            uniform asset info:sourceAsset = @opdef:/Vop/principledshader::2.0?DisplacementVexCode@
            token outputs:displacement
        }

        def Shader "Barrel1_preview"
        {
            uniform token info:id = "UsdPreviewSurface"
            float inputs:clearcoatRoughness = 0
            color3f inputs:diffuseColor = (1, 1, 1)
            color3f inputs:diffuseColor.connect = </materials/Barrel/Barrel1_preview_texture_diffuseColor.outputs:rgb>
            float inputs:metallic = 1
            float inputs:opacity.connect = </materials/Barrel/Barrel1_preview_texture_diffuseColor.outputs:a>
            float inputs:roughness = 1
            color3f inputs:specularColor = (1, 1, 1)
            token outputs:surface
        }

        def Shader "Barrel1_preview_uv"
        {
            uniform token info:id = "UsdPrimvarReader_float2"
            float2 inputs:fallback = (0, 0)
            token inputs:varname = "st"
            float2 outputs:result
        }

        def Shader "Barrel1_preview_texture_diffuseColor"
        {
            uniform token info:id = "UsdUVTexture"
            asset inputs:file = @../Textures/repacked_BarrelWithLid/repacked_BarrelWithLid_UV_1001_BaseColor.png@
            float4 inputs:scale = (1, 1, 1, 1)
            float2 inputs:st.connect = </materials/Barrel/Barrel1_preview_uv.outputs:result>
            token inputs:wrapS = "repeat"
            token inputs:wrapT = "repeat"
            float outputs:a
            color3f outputs:rgb
        }
    }
}

Attachments:
4.png (377.4 KB)

User Avatar
Member
10 posts
Joined: Aug. 2013
Offline
here when i even try to change it in the material usd to hard coded it to UDIM number 1001 directly
immediately the USD Reference file can read UDIM 1001

#usda 1.0
(
    metersPerUnit = 1
    upAxis = "Y"
)

def Scope "materials"
{
    def Material "Barrel"
    {
        token outputs:karma:displacement.connect = </materials/Barrel/Barrel1_displace.outputs:displacement>
        token outputs:karma:surface.connect = </materials/Barrel/Barrel1_surface.outputs:surface>
        token outputs:surface.connect = </materials/Barrel/Barrel1_preview.outputs:surface>

        def Shader "Barrel1_surface"
        {
            uniform token info:implementationSource = "sourceAsset"
            uniform asset info:sourceAsset = @opdef:/Vop/principledshader::2.0?SurfaceVexCode@
            vector3f inputs:basecolor = (1, 1, 1)
            asset inputs:basecolor_texture = "../Textures/repacked_BarrelWithLid/repacked_BarrelWithLid_UV_1001_BaseColor.png"
            int inputs:basecolor_useTexture = 1
            float inputs:metallic = 1
            float inputs:rough = 1
            token outputs:surface
        }

        def Shader "Barrel1_displace"
        {
            uniform token info:implementationSource = "sourceAsset"
            uniform asset info:sourceAsset = @opdef:/Vop/principledshader::2.0?DisplacementVexCode@
            token outputs:displacement
        }

        def Shader "Barrel1_preview"
        {
            uniform token info:id = "UsdPreviewSurface"
            float inputs:clearcoatRoughness = 0
            color3f inputs:diffuseColor = (1, 1, 1)
            color3f inputs:diffuseColor.connect = </materials/Barrel/Barrel1_preview_texture_diffuseColor.outputs:rgb>
            float inputs:metallic = 1
            float inputs:opacity.connect = </materials/Barrel/Barrel1_preview_texture_diffuseColor.outputs:a>
            float inputs:roughness = 1
            color3f inputs:specularColor = (1, 1, 1)
            token outputs:surface
        }

        def Shader "Barrel1_preview_uv"
        {
            uniform token info:id = "UsdPrimvarReader_float2"
            float2 inputs:fallback = (0, 0)
            token inputs:varname = "st"
            float2 outputs:result
        }

        def Shader "Barrel1_preview_texture_diffuseColor"
        {
            uniform token info:id = "UsdUVTexture"
            asset inputs:file = @../Textures/repacked_BarrelWithLid/repacked_BarrelWithLid_UV_1001_BaseColor.png@
            float4 inputs:scale = (1, 1, 1, 1)
            float2 inputs:st.connect = </materials/Barrel/Barrel1_preview_uv.outputs:result>
            token inputs:wrapS = "repeat"
            token inputs:wrapT = "repeat"
            float outputs:a
            color3f outputs:rgb
        }
    }
}

Attachments:
5.png (427.7 KB)

User Avatar
Member
10 posts
Joined: Aug. 2013
Offline
so i think its an issue of UDIM concatenation error.
i tried “<UDIM>” and tried “%(UDIM)d” and both are not working

i hope someone can help me find the missing link
Edited by Hazem Elshawaf - Sept. 12, 2020 08:11:16
User Avatar
Member
10 posts
Joined: Aug. 2013
Offline
ok … i found the issue
by default .. the USD ROP has an option in the output processing … called use relative path


this option makes the material USD file look like this


which makes the USD reference file render like this


but when i remove the option of “use relative path” the material USD file uses the full path of the textures


and the render read the UDIM normally

Attachments:
7.png (55.6 KB)
9.png (50.8 KB)
4.png (377.4 KB)
8.png (58.1 KB)
10.png (695.0 KB)

User Avatar
Member
7727 posts
Joined: Sept. 2011
Offline
Not sure why you are getting .. instead of .
the textures folder is at the same level as the main output.
I use relative paths without issue. Is your cwd different than $HIP?
User Avatar
Member
10 posts
Joined: Aug. 2013
Offline
when i put the material USD in the root folder (beside the hip file) the relative path became “ @/. ” because textures filer is beside material.usda


but when i save material.usda inside Materials folder .. the relative path will be “ @../ ” because the textures folder up one level from material.usda

Attachments:
11.png (89.9 KB)
12.png (60.3 KB)

User Avatar
Member
10 posts
Joined: Aug. 2013
Offline
i think what is happening with me is … if the path is relative path, the UDIM concatenation it can not be resolved … thats why when i write one patch number manually “like 1001” .. it can read the file “while its relative” and render it normally.

or .. if i make the path as absolute path, then the UDIM concatenation will work normally
User Avatar
Staff
4432 posts
Joined: July 2005
Online
Oh, sorry, there was an accidental backport of a change from the next Houdini version back to Houdini 18… Thanks for pointing this out. I'll fix this in the next couple of days (18.0.580 or 18.0.581).
User Avatar
Member
10 posts
Joined: Aug. 2013
Offline
mtucker
Oh, sorry, there was an accidental backport of a change from the next Houdini version back to Houdini 18… Thanks for pointing this out. I'll fix this in the next couple of days (18.0.580 or 18.0.581).

Great news .. thanks
i will be waiting for this update.

until then, i will be working with absolute path to keep learning Solaris.

i truly appreciate your efforts
Regards,
Hazem
  • Quick Links