From ecd498df857eddcb3fc98a731ce6175152d00818 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 14 May 2021 14:11:59 +0200 Subject: [PATCH] change pyblish MessageHandler emit method to convert messages to string at the moment of emmiting --- openpype/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/openpype/__init__.py b/openpype/__init__.py index f63d534e08..a86d2bc2be 100644 --- a/openpype/__init__.py +++ b/openpype/__init__.py @@ -67,6 +67,15 @@ def patched_discover(superclass): @import_wrapper def install(): """Install Pype to Avalon.""" + from pyblish.lib import MessageHandler + + def modified_emit(obj, record): + """Method replacing `emit` in Pyblish's MessageHandler.""" + record.msg = record.getMessage() + obj.records.append(record) + + MessageHandler.emit = modified_emit + log.info("Registering global plug-ins..") pyblish.register_plugin_path(PUBLISH_PATH) pyblish.register_discovery_filter(filter_pyblish_plugins)