Ftrack: Sync to avalon settings (#5353)

* replace 'statuses_name_change' with 'role_list' in settings

* use the settings in sync to avalon action
This commit is contained in:
Jakub Trllo 2023-07-26 13:40:29 +02:00 committed by GitHub
parent 04ef421f41
commit e6d9697e23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 11 deletions

View file

@ -40,6 +40,7 @@ class SyncToAvalonServer(ServerAction):
#: Action description.
description = "Send data from Ftrack to Avalon"
role_list = {"Pypeclub", "Administrator", "Project Manager"}
settings_key = "sync_to_avalon"
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@ -48,11 +49,16 @@ class SyncToAvalonServer(ServerAction):
def discover(self, session, entities, event):
""" Validation """
# Check if selection is valid
is_valid = False
for ent in event["data"]["selection"]:
# Ignore entities that are not tasks or projects
if ent["entityType"].lower() in ["show", "task"]:
return True
return False
is_valid = True
break
if is_valid:
is_valid = self.valid_roles(session, entities, event)
return is_valid
def launch(self, session, in_entities, event):
self.log.debug("{}: Creating job".format(self.label))

View file

@ -1,9 +1,10 @@
{
"events": {
"sync_to_avalon": {
"statuses_name_change": [
"ready",
"not ready"
"role_list": [
"Pypeclub",
"Administrator",
"Project manager"
]
},
"prepare_project": {

View file

@ -21,12 +21,9 @@
},
{
"type": "list",
"key": "statuses_name_change",
"label": "Statuses",
"object_type": {
"type": "text",
"multiline": false
}
"key": "role_list",
"label": "Roles",
"object_type": "text"
}
]
},