Skip to content

Commit

Permalink
Simplify fix for AYON Entity URI getting broken by os.path.normpath
Browse files Browse the repository at this point in the history
Remove `os.path.normpath` completely. This should be completely fine, we were already _not_ doing that anyway on `update()` logic. So now `load()` actually matches the `update()` logic.
  • Loading branch information
BigRoy committed Aug 30, 2024
1 parent ef99b00 commit 2aed406
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
8 changes: 1 addition & 7 deletions client/ayon_houdini/plugins/load/load_usd_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
lib
)

AYON_ENTITY_URI_PREFIXES = ("ayon://", "ayon+entity://")


class USDSublayerLoader(plugin.HoudiniLoader):
"""Sublayer USD file in Solaris"""
Expand All @@ -26,15 +24,11 @@ class USDSublayerLoader(plugin.HoudiniLoader):
use_ayon_entity_uri = False

def load(self, context, name=None, namespace=None, data=None):

import os
import hou

# Format file name, Houdini only wants forward slashes
file_path = self.filepath_from_context(context)
if not file_path.startswith(AYON_ENTITY_URI_PREFIXES):
file_path = os.path.normpath(file_path)
file_path = file_path.replace("\\", "/")
file_path = file_path.replace("\\", "/")

# Get the root node
stage = hou.node("/stage")
Expand Down
8 changes: 1 addition & 7 deletions client/ayon_houdini/plugins/load/load_usd_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
lib
)

AYON_ENTITY_URI_PREFIXES = ("ayon://", "ayon+entity://")


class USDReferenceLoader(plugin.HoudiniLoader):
"""Reference USD file in Solaris"""
Expand All @@ -26,15 +24,11 @@ class USDReferenceLoader(plugin.HoudiniLoader):
use_ayon_entity_uri = False

def load(self, context, name=None, namespace=None, data=None):

import os
import hou

# Format file name, Houdini only wants forward slashes
file_path = self.filepath_from_context(context)
if not file_path.startswith(AYON_ENTITY_URI_PREFIXES):
file_path = os.path.normpath(file_path)
file_path = file_path.replace("\\", "/")
file_path = file_path.replace("\\", "/")

# Get the root node
stage = hou.node("/stage")
Expand Down
3 changes: 0 additions & 3 deletions client/ayon_houdini/plugins/load/load_usd_sop.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os

from ayon_houdini.api import (
pipeline,
plugin
Expand All @@ -23,7 +21,6 @@ def load(self, context, name=None, namespace=None, data=None):

# Format file name, Houdini only wants forward slashes
file_path = self.filepath_from_context(context)
file_path = os.path.normpath(file_path)
file_path = file_path.replace("\\", "/")

# Get the root node
Expand Down

0 comments on commit 2aed406

Please sign in to comment.