mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-27 06:12:19 +01:00
fixed registration of sync action
This commit is contained in:
parent
fe55ad0df4
commit
6367d24a1d
1 changed files with 22 additions and 1 deletions
|
|
@ -2067,12 +2067,13 @@ class SyncToAvalonServer(BaseAction):
|
|||
#: Action description.
|
||||
description = "Send data from Ftrack to Avalon"
|
||||
#: Action icon.
|
||||
|
||||
icon = "{}/ftrack/action_icons/PypeAdmin.svg".format(
|
||||
os.environ.get(
|
||||
"PYPE_STATICS_SERVER",
|
||||
"http://localhost:{}".format(
|
||||
config.get_presets().get("services", {}).get(
|
||||
"statics_server", {}
|
||||
"rest_api", {}
|
||||
).get("default_port", 8021)
|
||||
)
|
||||
)
|
||||
|
|
@ -2080,6 +2081,26 @@ class SyncToAvalonServer(BaseAction):
|
|||
#: roles that are allowed to register this action
|
||||
role_list = ["Pypeclub"]
|
||||
|
||||
def register(self):
|
||||
'''
|
||||
Registers the action, subscribing the the discover and launch topics.
|
||||
- highest priority event will show last
|
||||
'''
|
||||
self.session.event_hub.subscribe(
|
||||
'topic=ftrack.action.discover',
|
||||
self._discover,
|
||||
priority=self.priority
|
||||
)
|
||||
|
||||
launch_subscription = (
|
||||
'topic=ftrack.action.launch'
|
||||
' and data.actionIdentifier={0}'
|
||||
).format(self.identifier)
|
||||
self.session.event_hub.subscribe(
|
||||
launch_subscription,
|
||||
self._launch
|
||||
)
|
||||
|
||||
def discover(self, session, entities, event):
|
||||
""" Validation """
|
||||
# Check if selection is valid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue