From 8e62fecb852e52a671b63f79bb2607bdbf91bf97 Mon Sep 17 00:00:00 2001 From: Jerry Gamache Date: Thu, 14 Dec 2023 13:42:14 -0500 Subject: [PATCH 1/3] LOOKDEVX-2260 - Fix Linux icon paths --- lib/mayaUsd/ufe/MayaUsdUIInfoHandler.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/mayaUsd/ufe/MayaUsdUIInfoHandler.cpp b/lib/mayaUsd/ufe/MayaUsdUIInfoHandler.cpp index 40e20ed803..ea3e0d122b 100644 --- a/lib/mayaUsd/ufe/MayaUsdUIInfoHandler.cpp +++ b/lib/mayaUsd/ufe/MayaUsdUIInfoHandler.cpp @@ -140,8 +140,18 @@ class _MayaIconResolver void ResetCache() { - _iconContext = PXR_NS::ArDefaultResolverContext( - PXR_NS::TfStringSplit(PXR_NS::TfGetenv("XBMLANGPATH", ""), ARCH_PATH_LIST_SEP)); + auto pathVector + = PXR_NS::TfStringSplit(PXR_NS::TfGetenv("XBMLANGPATH", ""), ARCH_PATH_LIST_SEP); +#ifdef __linux__ + // The paths on Linux end with /%B. Trim that: + for (auto&& path : pathVector) { + const auto pathLen = path.size(); + if (pathLen > 3 && path.substr(pathLen - 3) == "/%B") { + path = path.substr(0, pathLen - 3); + } + } +#endif + _iconContext = PXR_NS::ArDefaultResolverContext(pathVector); _searchCache.clear(); } From 589098dfa9020c60ef2685f481cd30daeba3a06f Mon Sep 17 00:00:00 2001 From: Jerry Gamache Date: Thu, 14 Dec 2023 14:35:31 -0500 Subject: [PATCH 2/3] Responding to review comments --- lib/mayaUsd/ufe/MayaUsdUIInfoHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mayaUsd/ufe/MayaUsdUIInfoHandler.cpp b/lib/mayaUsd/ufe/MayaUsdUIInfoHandler.cpp index ea3e0d122b..d01d61699d 100644 --- a/lib/mayaUsd/ufe/MayaUsdUIInfoHandler.cpp +++ b/lib/mayaUsd/ufe/MayaUsdUIInfoHandler.cpp @@ -146,7 +146,7 @@ class _MayaIconResolver // The paths on Linux end with /%B. Trim that: for (auto&& path : pathVector) { const auto pathLen = path.size(); - if (pathLen > 3 && path.substr(pathLen - 3) == "/%B") { + if (pathLen >= 3 && path.substr(pathLen - 3) == "/%B") { path = path.substr(0, pathLen - 3); } } From 8ee60a6282ccd92899e359fc6d42c5ab38d1a71e Mon Sep 17 00:00:00 2001 From: Jerry Gamache Date: Thu, 14 Dec 2023 14:47:56 -0500 Subject: [PATCH 3/3] Using CMake compiler define instead of GCC define for Linux platforms. --- lib/mayaUsd/ufe/MayaUsdUIInfoHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mayaUsd/ufe/MayaUsdUIInfoHandler.cpp b/lib/mayaUsd/ufe/MayaUsdUIInfoHandler.cpp index d01d61699d..496fb0a642 100644 --- a/lib/mayaUsd/ufe/MayaUsdUIInfoHandler.cpp +++ b/lib/mayaUsd/ufe/MayaUsdUIInfoHandler.cpp @@ -142,7 +142,7 @@ class _MayaIconResolver { auto pathVector = PXR_NS::TfStringSplit(PXR_NS::TfGetenv("XBMLANGPATH", ""), ARCH_PATH_LIST_SEP); -#ifdef __linux__ +#ifdef LINUX // The paths on Linux end with /%B. Trim that: for (auto&& path : pathVector) { const auto pathLen = path.size();