Skip to content

Commit

Permalink
Move publishError to the caller publish plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
MustafaJafar committed Dec 6, 2024
1 parent 452f73e commit ce5a314
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 4 additions & 4 deletions client/ayon_houdini/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ def get_lops_rop_context_options(
end: float = ropnode.evalParm("f2")
inc: float = ropnode.evalParm("f3")
else:
raise PublishError(f"Unsupported trange value: {trange}"
f" for rop node: {ropnode.path()}")
raise ValueError(f"Unsupported trange value: {trange}"
f" for rop node: {ropnode.path()}")
rop_context_options["ropcook"] = 1.0
rop_context_options["ropstart"] = start
rop_context_options["ropend"] = end
Expand All @@ -162,8 +162,8 @@ def get_lops_rop_context_options(
elif option_type == "float":
value: float = ropnode.evalParm(f"optionfloatvalue{i}")
else:
raise PublishError(f"Unsupported option type: {option_type}"
f" on rop node: '{ropnode.path()}'")
raise ValueError(f"Unsupported option type: {option_type}"
f" on rop node: '{ropnode.path()}'")
rop_context_options[name] = value

return rop_context_options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from pxr import Sdf, Usd
import pyblish.api

from ayon_core.pipeline import PublishError
from ayon_houdini.api import plugin
from ayon_houdini.api.lib import (
get_lops_rop_context_options,
Expand Down Expand Up @@ -82,7 +83,13 @@ def process(self, instance):

lop_node: hou.LopNode
rop: hou.RopNode = hou.node(instance.data["instance_node"])
options = get_lops_rop_context_options(rop)
try:
options = get_lops_rop_context_options(rop)
except hou.Error as exc:
raise PublishError(
f"Failed to get context options on rop: {rop.path()}",
detail=f"{exc}"
)

# Log the context options
self.log.debug(
Expand Down

0 comments on commit ce5a314

Please sign in to comment.