mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
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:
parent
04ef421f41
commit
e6d9697e23
3 changed files with 15 additions and 11 deletions
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
{
|
||||
"events": {
|
||||
"sync_to_avalon": {
|
||||
"statuses_name_change": [
|
||||
"ready",
|
||||
"not ready"
|
||||
"role_list": [
|
||||
"Pypeclub",
|
||||
"Administrator",
|
||||
"Project manager"
|
||||
]
|
||||
},
|
||||
"prepare_project": {
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue