diff --git a/colorbleed/plugins/houdini/publish/extract_alembic.py b/colorbleed/plugins/houdini/publish/extract_alembic.py index f817a25c86..8872372484 100644 --- a/colorbleed/plugins/houdini/publish/extract_alembic.py +++ b/colorbleed/plugins/houdini/publish/extract_alembic.py @@ -13,6 +13,8 @@ class ExtractAlembic(colorbleed.api.Extractor): def process(self, instance): + import hou + ropnode = instance[0] # Get the filename from the filename parameter @@ -25,7 +27,15 @@ class ExtractAlembic(colorbleed.api.Extractor): # We run the render self.log.info("Writing alembic '%s' to '%s'" % (file_name, staging_dir)) - ropnode.render() + try: + ropnode.render() + except hou.Error as exc: + # The hou.Error is not inherited from a Python Exception class, + # so we explicitly capture the houdini error, otherwise pyblish + # will remain hanging. + import traceback + traceback.print_exc() + raise RuntimeError("Render failed: {0}".format(exc)) if "files" not in instance.data: instance.data["files"] = [] diff --git a/colorbleed/plugins/houdini/publish/extract_vdb_cache.py b/colorbleed/plugins/houdini/publish/extract_vdb_cache.py index 337460dd58..7fe443b5a1 100644 --- a/colorbleed/plugins/houdini/publish/extract_vdb_cache.py +++ b/colorbleed/plugins/houdini/publish/extract_vdb_cache.py @@ -13,6 +13,8 @@ class ExtractVDBCache(colorbleed.api.Extractor): def process(self, instance): + import hou + ropnode = instance[0] # Get the filename from the filename parameter @@ -23,7 +25,15 @@ class ExtractVDBCache(colorbleed.api.Extractor): file_name = os.path.basename(sop_output) self.log.info("Writing VDB '%s' to '%s'" % (file_name, staging_dir)) - ropnode.render() + try: + ropnode.render() + except hou.Error as exc: + # The hou.Error is not inherited from a Python Exception class, + # so we explicitly capture the houdini error, otherwise pyblish + # will remain hanging. + import traceback + traceback.print_exc() + raise RuntimeError("Render failed: {0}".format(exc)) if "files" not in instance.data: instance.data["files"] = []