Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path resolution for mounted volumes in Windows does not work correctly #1520

Closed
williamkrick opened this issue May 17, 2021 · 2 comments
Closed

Comments

@williamkrick
Copy link
Contributor

Description of Issue

Opening a USD file which uses anchored file paths from a mounted volume in windows doesn't work. The resolved volume GUID is not properly formatted and so the system cannot find the files. MayaUSD reports the volume GUID is something like C:\??\Volume{009b65f5-0000-0000-0004-000000000000}\RTS\referenced_files\USD\barrelTests\Library\Assets\Barrels\Textures\repacked_BarrelWithLid\repacked_BarrelWithLid_UV_<UDIM>_BaseColor.png.

According to the documentation on volume GUIDs the format of the volume GUID is not correct. The string should be something like \\?\Volume{{009b65f5-0000-0000-0004-000000000000}\the\rest\of\the\path.

Debugging the code, what I see happen is:

  • There is a call to _WalkGraph in materialParamUtils.cpp for the shader node. That call finds the usd shade input attribute and calls UsdImaging_ResolveMaterialParamValue on it. The starting value of the assetPath looks like ../Textures/repacked_BarrelWithLid/repacked_BarrelWithLid_UV_<UDIM>_BaseColor.png
  • As a part of resolving the path there is a call to SdfComputeAssetPathRelativeToLayer. After this call the resolved path is correct. If I copy that string from the debugger I can get windows to open it. The resolved path is: d:/MAYA-105710/RTS/referenced_files/USD/barrelTests/Library/Assets/Barrels/Textures/repacked_BarrelWithLid/repacked_BarrelWithLid_UV_1001_BaseColor.png. The code still has to replace the 1001 with again, but that part of the code just hasn't execute yet. This path is correct and can be correctly opened.
  • Before resolving finishes there is a call to _ResolveSymlinks. This discovers that d:\MAYA-105710 is a IO_REPARSE_TAG_MOUNT_POINT and returns the contents of the mount point reparse buffer, which are \\??\\Volume{e7716c21-89be-11eb-bea8-50e085f32ec9}\\
  • Eventually, the incorrect volume GUID path gets concatenated with the rest of the path, and HdVP2Material tries to find the UDIM textures, but none of them work because the path is not correct.

The changes in pull request #1378 add support for handling windows symbolic links. The changes there don't seem to account for the possibility that the volume GUID string may not be directly usable. The concatenation of the drive path also seems to be incorrectly including C: at the beginning of the path. If I follow the documentation and create a volume GUID path of \\?\Volume{e7716c21-89be-11eb-bea8-50e085f32ec9}\the\rest\of\the\path then I am able to correctly access the files.

In the usd-interest discussion one proposed solution was to detect this case and not use the volume GUID.

Steps to Reproduce

Mount an external drive on windows:

  1. Connect the external drive (such as a USB stick) to your computer.
  2. Go to Disk Management.
  3. Right click on your connected drive.
  4. Select "Change Drive Letter and Path..."
  5. Select "Add".
  6. Use "Mount in the following empty NTFS folder:"
  7. Locate the folder you want to mount to.
  8. Extract the attached Barrels.zip to that location.
  9. Create a stage from Barrels/Barrels.usd.
    In UsdView, this crashes.
    In MayaUSD, it reports an error like: // Warning: Unable to find UDIM tiles for C:\??\Volume{009b65f5-0000-0000-0004-000000000000}\RTS\referenced_files\USD\barrelTests\Library\Assets\Barrels\Textures\repacked_BarrelWithLid\repacked_BarrelWithLid_UV_<UDIM>_BaseColor.png //

System Information (OS, Hardware)

Windows 10 version 2004 with KB5001330 (from April 19th, 2021)

Package Versions

USD v21.05

Build Flags

@jtran56
Copy link

jtran56 commented May 21, 2021

Filed as internal issue #USD-6700

@sunyab
Copy link
Contributor

sunyab commented Aug 13, 2022

Closing old issue, this was addressed by #1746.

@sunyab sunyab closed this as completed Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants