From 5ac8394797df215fe0fba987d9f34788b1d02265 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Fri, 21 Dec 2018 09:22:04 +0100 Subject: [PATCH] Fix PLN-220: ROP render error hangs Pyblish - It's because Houdini errors are old-style class error, those seem to hang Pyblish QML - See: https://gitter.im/pyblish/pyblish?at=5c1bdb49b8760c21bbfbee7b --- .../plugins/houdini/publish/extract_alembic.py | 12 +++++++++++- .../plugins/houdini/publish/extract_vdb_cache.py | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) 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"] = []