mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
trigger 'openpype.project.created' in sync actions because session avalon sync is not with event hub
This commit is contained in:
parent
b340bd532d
commit
606b057ab0
3 changed files with 18 additions and 9 deletions
|
|
@ -1,7 +1,8 @@
|
|||
import time
|
||||
import sys
|
||||
import json
|
||||
import traceback
|
||||
|
||||
import ftrack_api
|
||||
|
||||
from openpype_modules.ftrack.lib import ServerAction
|
||||
from openpype_modules.ftrack.lib.avalon_sync import SyncEntitiesFactory
|
||||
|
|
@ -180,6 +181,13 @@ class SyncToAvalonServer(ServerAction):
|
|||
"* Total time: {}".format(time_7 - time_start)
|
||||
)
|
||||
|
||||
if self.entities_factory.project_created:
|
||||
event = ftrack_api.event.base.Event(
|
||||
topic="openpype.project.created",
|
||||
data={"project_name": project_name}
|
||||
)
|
||||
self.session.event_hub.publish(event)
|
||||
|
||||
report = self.entities_factory.report()
|
||||
if report and report.get("items"):
|
||||
default_title = "Synchronization report ({}):".format(
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import time
|
||||
import sys
|
||||
import json
|
||||
import traceback
|
||||
|
||||
import ftrack_api
|
||||
|
||||
from openpype_modules.ftrack.lib import BaseAction, statics_icon
|
||||
from openpype_modules.ftrack.lib.avalon_sync import SyncEntitiesFactory
|
||||
|
|
@ -184,6 +185,13 @@ class SyncToAvalonLocal(BaseAction):
|
|||
"* Total time: {}".format(time_7 - time_start)
|
||||
)
|
||||
|
||||
if self.entities_factory.project_created:
|
||||
event = ftrack_api.event.base.Event(
|
||||
topic="openpype.project.created",
|
||||
data={"project_name": project_name}
|
||||
)
|
||||
self.session.event_hub.publish(event)
|
||||
|
||||
report = self.entities_factory.report()
|
||||
if report and report.get("items"):
|
||||
default_title = "Synchronization report ({}):".format(
|
||||
|
|
|
|||
|
|
@ -2017,13 +2017,6 @@ class SyncEntitiesFactory:
|
|||
if len(self.create_list) > 0:
|
||||
self.dbcon.insert_many(self.create_list)
|
||||
|
||||
if self.project_created:
|
||||
event = ftrack_api.event.base.Event(
|
||||
topic="openpype.project.created",
|
||||
data={"project_name": self.project_name}
|
||||
)
|
||||
self.session.event_hub.publish(event)
|
||||
|
||||
self.session.commit()
|
||||
|
||||
self.log.debug("* Processing entities for update")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue