-
Notifications
You must be signed in to change notification settings - Fork 202
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
MAYA-105710: fix USD files fail to load on mapped mounted volume. #1422
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great find @HamedSabri-adsk !
We are changing what resolveRelativePathWithinMayaContext
is returning, i.e. used to be the canonical version of the path. This path is consumed then by a few different methods inside of proxy shape compute, including opening/finding a layer for a given path. I was wondering how it will work for layer identifiers and whether or not they will include non-canonical paths...but everything seems to be correct there.
I'm fine with the change, but two things would be good considering doing:
- Creating a defect in gulrak
- Check with @fabal if this change will work for AL as well. I remember we refactored this method out of the AL plugin so there may be additional dependencies we don't know about that require returned path to be canonical.
…canonical - Revert back changes to use ghc::filesystem::canonical again.
@@ -38,7 +38,7 @@ else() | |||
FetchContent_Declare( | |||
${CONTENT_NAME} | |||
GIT_REPOSITORY https://github.com/gulrak/filesystem.git | |||
GIT_TAG 3d3c02ce35dcc68b5ebb34f21cb1fc507be9a66e | |||
GIT_TAG 4e21ab305794f5309a1454b4ae82ab9a0f5e0d25 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching to v 1.5.6 which fixed the bug in ghc::filesystem::canonical
lib/mayaUsd/utils/utilFileSystem.cpp
Outdated
auto path = ghc::filesystem::path(currentFileDir).append(relativeFilePath); | ||
std::error_code errorCode; | ||
auto path = ghc::filesystem::canonical( | ||
ghc::filesystem::path(currentFileDir).append(relativeFilePath), errorCode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert my workaround now that bug is fixed.
This PR fixes the issue with loading usd from mapped drivers.
Steps to reproduce the error:
Note: Opening the same file if saved on a local drive or a network drive works without issues.
Description:
There is a bug in
gulark's filesystem::canonical
which fails to properly resolve relative path. C++17 std::filesystem::canonical doesn't have this issue and properly resolves the relative path.ghc::filesystem::canonical
std::filesystem::canonical
Workaround:
To work around this, I removed the need to call
filesystem::canonical
all together since the given path toArGetResolver().ConfigureResolverForAsset
is resolved properly.maya-usd/lib/mayaUsd/nodes/proxyShapeBase.cpp
Line 660 in 092f520
e.g
C:\\MOUNT_ME\\RTS\\RTS\\master_files\\..\\referenced_files\\USD\\barrelTests\\Library\\Assets\\Barrels\\Barrels.usd