diff --git a/CMakeLists.txt b/CMakeLists.txt index a077dd0..987f49a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,6 +114,9 @@ if("$ENV{AR_DCC_NAME}" STREQUAL "HOUDINI") elseif(EXISTS "${AR_HOUDINI_ROOT}/python/bin/python3.9") set(AR_PYTHON_LIB python3.9) set(AR_PYTHON_LIB_NUMBER python39) + elseif(EXISTS "${AR_HOUDINI_ROOT}/python/bin/python3.7m") + set(AR_PYTHON_LIB python3.7m) + set(AR_PYTHON_LIB_NUMBER python37) else() set(AR_PYTHON_LIB python3.7) set(AR_PYTHON_LIB_NUMBER python37) diff --git a/docs/src/resolvers/CachedResolver/example.md b/docs/src/resolvers/CachedResolver/example.md index fa872e6..67f6d27 100644 --- a/docs/src/resolvers/CachedResolver/example.md +++ b/docs/src/resolvers/CachedResolver/example.md @@ -185,7 +185,7 @@ class ResolverContext: re-applies the correct mapping. If the identifier is encountered again it will use the C++ cache, which means everything is kept fast. """ ####### - base_identifier = assetPath.removeprefix(RELATIVE_PATH_IDENTIFIER_PREFIX) + base_identifier = assetPath[len(RELATIVE_PATH_IDENTIFIER_PREFIX):] anchor_path, entity_element = base_identifier.split("?") entity_type, entity_identifier = anchor_path.split("/") entity_element, entity_version = entity_element.split("-") diff --git a/files/implementations/CachedResolver/code/PythonExpose.py b/files/implementations/CachedResolver/code/PythonExpose.py index c048c6c..13e2470 100644 --- a/files/implementations/CachedResolver/code/PythonExpose.py +++ b/files/implementations/CachedResolver/code/PythonExpose.py @@ -119,7 +119,7 @@ def ResolveAndCache(context, assetPath): ) resolved_asset_path = "" if assetPath.startswith(RELATIVE_PATH_IDENTIFIER_PREFIX): - base_identifier = assetPath.removeprefix(RELATIVE_PATH_IDENTIFIER_PREFIX) + base_identifier = assetPath[len(RELATIVE_PATH_IDENTIFIER_PREFIX):] anchor_path, entity_element = base_identifier.split("?") entity_type, entity_identifier = anchor_path.split("/") entity_element, entity_version = entity_element.split("-") diff --git a/src/CachedResolver/PythonExpose.py b/src/CachedResolver/PythonExpose.py index 19de04d..56b863d 100644 --- a/src/CachedResolver/PythonExpose.py +++ b/src/CachedResolver/PythonExpose.py @@ -126,8 +126,11 @@ def ResolveAndCache(context, assetPath): asset_b_file_path = os.path.join(current_dir_path, "assetB.usd") context.AddCachingPair("assetA.usd", asset_a_file_path) context.AddCachingPair("assetB.usd", asset_b_file_path) - if assetPath.startswith("relativePath|"): - relative_path, anchor_path = assetPath.removeprefix("relativePath|").split("?") + relative_path_prefix = "relativePath|" + if assetPath.startswith(relative_path_prefix): + relative_path, anchor_path = assetPath[len(relative_path_prefix) :].split( + "?" + ) anchor_path = anchor_path[:-1] if anchor_path[-1] == "/" else anchor_path[:anchor_path.rfind("/")] resolved_asset_path = os.path.normpath(os.path.join(anchor_path, relative_path)) context.AddCachingPair(assetPath, resolved_asset_path)