diff --git a/pype/ftrack/events/action_sync_to_avalon.py b/pype/ftrack/events/action_sync_to_avalon.py index bc6a6b487b..9862c13d66 100644 --- a/pype/ftrack/events/action_sync_to_avalon.py +++ b/pype/ftrack/events/action_sync_to_avalon.py @@ -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