From 68b1d0b16c59b66896d4dbca085cf0b1aa57be58 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 18 Aug 2021 17:16:55 +0200 Subject: [PATCH] added publish started callback --- openpype/tools/new_publisher/control.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openpype/tools/new_publisher/control.py b/openpype/tools/new_publisher/control.py index 4909906518..3c02ec5e45 100644 --- a/openpype/tools/new_publisher/control.py +++ b/openpype/tools/new_publisher/control.py @@ -156,6 +156,7 @@ class PublisherController: # Varianbles where callbacks are stored self._instances_refresh_callback_refs = set() self._plugins_refresh_callback_refs = set() + self._publishing_started_callback_refs = set() self._publish_instance_changed_callback_refs = set() self._publish_plugin_changed_callback_refs = set() self._publishing_stopped_callback_refs = set() @@ -199,6 +200,10 @@ class PublisherController: ref = weakref.WeakMethod(callback) self._plugins_refresh_callback_refs.add(ref) + def add_publish_started_callback(self, callback): + ref = weakref.WeakMethod(callback) + self._publishing_started_callback_refs.add(ref) + def add_instance_change_callback(self, callback): ref = weakref.WeakMethod(callback) self._publish_instance_changed_callback_refs.add(ref) @@ -360,6 +365,8 @@ class PublisherController: self._start_publish() def _start_publish(self): + """Start or continue in publishing.""" + self._trigger_callbacks(self._publishing_started_callback_refs) self._main_thread_processor.start() self._publish_next_process()