Skip to content

Commit

Permalink
Move the PublishError to the collector
Browse files Browse the repository at this point in the history
  • Loading branch information
MustafaJafar committed Dec 5, 2024
1 parent 84be3d4 commit ece72b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 2 additions & 5 deletions client/ayon_houdini/api/usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
import ayon_api
from pxr import Usd, Sdf, Tf, Vt, UsdRender

from ayon_core.pipeline.publish import PublishError


log = logging.getLogger(__name__)


Expand Down Expand Up @@ -208,8 +205,8 @@ def get_configured_save_layers(usd_rop, strip_above_layer_break=True):
lop_node = get_usd_rop_loppath(usd_rop)
stage = lop_node.stage(apply_viewport_overrides=False)
if not stage:
raise PublishError(
f"No valid USD stage for ROP node: '{usd_rop.path()}' "
raise RuntimeError(
"No valid USD stage for ROP node: " "%s" % usd_rop.path()
)

root_layer = stage.GetRootLayer()
Expand Down
10 changes: 9 additions & 1 deletion client/ayon_houdini/plugins/publish/collect_usd_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,15 @@ def process(self, instance):
rop_node = hou.node(instance.data["instance_node"])

save_layers = []
for layer in usdlib.get_configured_save_layers(rop_node):
try:
layers = usdlib.get_configured_save_layers(rop_node)
except Exception as exc:
raise PublishError(
f"Failed to get USD layers on rop node '{rop_node}'",
detail=f"{exc}"
)

for layer in layers:

info = layer.rootPrims.get("HoudiniLayerInfo")
save_path = info.customData.get("HoudiniSavePath")
Expand Down

0 comments on commit ece72b3

Please sign in to comment.