Skip to content

Commit

Permalink
Add Houdini py7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaScheller committed Aug 16, 2024
1 parent 4b18c04 commit 1b1ca6f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/resolvers/CachedResolver/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -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("-")
Expand Down
2 changes: 1 addition & 1 deletion files/implementations/CachedResolver/code/PythonExpose.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("-")
Expand Down
7 changes: 5 additions & 2 deletions src/CachedResolver/PythonExpose.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1b1ca6f

Please sign in to comment.