From 75bfcb0f4058294d816eee9e242d72fef98c816d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 23 Dec 2020 11:50:03 +0100 Subject: [PATCH] action discover by roles --- .../events/action_push_frame_values_to_task.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pype/modules/ftrack/events/action_push_frame_values_to_task.py b/pype/modules/ftrack/events/action_push_frame_values_to_task.py index 87d9d5afe9..a1c2f870fe 100644 --- a/pype/modules/ftrack/events/action_push_frame_values_to_task.py +++ b/pype/modules/ftrack/events/action_push_frame_values_to_task.py @@ -61,16 +61,22 @@ class PushHierValuesToNonHier(ServerAction): # configurable interest_entity_types = ["Shot"] interest_attributes = ["frameStart", "frameEnd"] - role_list = ["Pypeclub", "Administrator", "Project Manager"] + + settings_key = "sync_hier_entity_attributes" 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 ("task", "show"): - 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, entities, event): self.log.debug("{}: Creating job".format(self.label))