Merge pull request #217 from BigRoy/houdini_fixes

Fix PLN-220: ROP render error hangs Pyblish
This commit is contained in:
Roy Nieterau 2018-12-21 09:22:58 +01:00 committed by GitHub
commit 3f9b9a193e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 2 deletions

View file

@ -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"] = []

View file

@ -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"] = []