@@ -61,7 +61,7 @@ _AnchorRelativePath(
6161 const std::string& path)
6262{
6363 if (TfIsRelativePath (anchorPath) ||
64- !_IsRelativePath (path)) {
64+ !_IsFileRelativePath (path)) {
6565 return path;
6666 }
6767 // Ensure we are using forward slashes and not back slashes.
@@ -74,18 +74,6 @@ _AnchorRelativePath(
7474 return TfNormPath (anchoredPath);
7575}
7676
77- static ArResolvedPath
78- _ResolveAnchored (
79- const std::string& anchorPath,
80- const std::string& path)
81- {
82- std::string resolvedPath = path;
83- if (!anchorPath.empty ()) {
84- resolvedPath = TfStringCatPaths (anchorPath, path);
85- }
86- return TfPathExists (resolvedPath) ? ArResolvedPath (TfAbsPath (resolvedPath)) : ArResolvedPath ();
87- }
88-
8977CachedResolver::CachedResolver () {
9078 this ->SetExposeAbsolutePathIdentifierState (TfGetenvBool (DEFINE_STRING (AR_CACHEDRESOLVER_ENV_EXPOSE_ABSOLUTE_PATH_IDENTIFIERS ), false ));
9179 this ->SetExposeRelativePathIdentifierState (TfGetenvBool (DEFINE_STRING (AR_CACHEDRESOLVER_ENV_EXPOSE_RELATIVE_PATH_IDENTIFIERS ), false ));
@@ -174,13 +162,6 @@ CachedResolver::_CreateIdentifier(
174162 }
175163 }
176164 }
177- // Anchor non file path based identifiers and see if a file exists.
178- // This is mostly for debugging as it allows us to add a file relative to our
179- // anchor directory that has a higher priority than our (usually unanchored)
180- // resolved asset path.
181- if (_IsNotFilePath (assetPath) && Resolve (anchoredAssetPath).empty ()) {
182- return TfNormPath (assetPath);
183- }
184165 return TfNormPath (anchoredAssetPath);
185166}
186167
@@ -213,9 +194,6 @@ CachedResolver::_Resolve(
213194 if (assetPath.empty ()) {
214195 return ArResolvedPath ();
215196 }
216- if (SdfLayer::IsAnonymousLayerIdentifier (assetPath)){
217- return ArResolvedPath (assetPath);
218- }
219197
220198 if (this ->_IsContextDependentPath (assetPath)) {
221199 const CachedResolverContext* contexts[2 ] = {this ->_GetCurrentContextPtr (), &_fallbackContext};
@@ -225,7 +203,7 @@ CachedResolver::_Resolve(
225203 auto &mappingPairs = ctx->GetMappingPairs ();
226204 auto map_find = mappingPairs.find (assetPath);
227205 if (map_find != mappingPairs.end ()){
228- ArResolvedPath resolvedPath = _ResolveAnchored ( this -> emptyString , map_find->second );
206+ ArResolvedPath resolvedPath = ArResolvedPath ( TfAbsPath ( map_find->second ) );
229207 return resolvedPath;
230208 // Assume that a map hit is always valid.
231209 // if (resolvedPath) {
@@ -236,7 +214,7 @@ CachedResolver::_Resolve(
236214 auto &cachedPairs = ctx->GetCachingPairs ();
237215 auto cache_find = cachedPairs.find (assetPath);
238216 if (cache_find != cachedPairs.end ()){
239- ArResolvedPath resolvedPath = _ResolveAnchored ( this -> emptyString , cache_find->second );
217+ ArResolvedPath resolvedPath = ArResolvedPath ( TfAbsPath ( cache_find->second ) );
240218 return resolvedPath;
241219 // Assume that a cache hit is always valid.
242220 // if (resolvedPath) {
@@ -250,7 +228,7 @@ CachedResolver::_Resolve(
250228 allow for resolver multithreading with different contexts.
251229 See .ResolveAndCachePair for more information.
252230 */
253- ArResolvedPath resolvedPath = _ResolveAnchored ( this -> emptyString , ctx->ResolveAndCachePair (assetPath));
231+ ArResolvedPath resolvedPath = ArResolvedPath ( TfAbsPath ( ctx->ResolveAndCachePair (assetPath) ));
254232 if (resolvedPath) {
255233 return resolvedPath;
256234 }
@@ -261,7 +239,7 @@ CachedResolver::_Resolve(
261239 return ArResolvedPath ();
262240 }
263241
264- return _ResolveAnchored ( std::string (), assetPath);
242+ return TfPathExists (assetPath) ? ArResolvedPath ( TfAbsPath ( assetPath)) : ArResolvedPath ( );
265243}
266244
267245ArResolvedPath
0 commit comments