Duncan

Members
  • Content Count

    6
  • Joined

  • Last visited

About Duncan

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Duncan

    Task Status Update

    Ah, I hadn't seen that example. I'll take a look at that. Thanks very much.
  2. Duncan

    Task Status Update

    Hi All, I'm trying to create an event listener to update task statuses based on changes made to dependent statuses. For example, when render task is marked as "complete" the Comp task is changed to "Ready". This is some of the code I have so far - def InBetweens_Status (task, status): if status['name'] == "InProgress": Shot = task['parent'] Render = Shot['children'][4] if Render['status']['name'] == "NotStarted": print "No change" if Render['status']['name'] == "InProgress": print "Do something" def Update_Statuses(event): for entity in event['data'].get('entities', []): if entity.get('entity_type') == 'Task' and entity['action'] == 'update': entity_Id = entity['entityId'] task = session.get('Task',entity_Id) Status_Id = entity['changes']['statusid']['new'] status = session.get('Status',Status_Id) InBetweens(task, status) # Subscribe to events with the update topic. session = ftrack_api.Session(auto_connect_event_hub=True) session.event_hub.subscribe('topic=ftrack.update', Update_Statuses) session.event_hub.wait() This works and gives me the status of the 'Render' task related to my 'InBetweens' task, however if I change that status and then update the status of the 'InBetweens' again it returns the original 'Render' status rather than the new one. Any idea why this would be happening? Thanks in advance,
  3. Hi Johan, That works perfectly, thanks very much. Duncan
  4. Hi all, I'm trying to create an action to create a .csv file from the comments posted onto Client Reviews so that we can sort them and use them a markers on our Avid system. So far I have managed to get 'reviewFrame' and 'content' which is great, but I am having trouble getting the 'author'. For some reason it is coming up as none when I query it, even though on the interface the note definitely has an author name attached. Is there something I'm missing?
  5. OK I've just found the houdini tutorial here - http://ftrack-connect.rtd.ftrack.com/en/stable/developing/tutorial/custom_applications.html and that seems to be working, so I will work on adapting that...
  6. Hi all, I'm just starting with creating custom actions but I am having trouble getting any of them to show up. For example, just to test, I have tried adding this code, which I found on a thread here, to my \ftrack-connect-plugins\hook\ folder- import ftrack_api class TestAction(object): identifier = "test_action" label = "Test Action" def __init__(self, session): super(TestAction, self).__init__() self.session = session def register(self): self.session.event_hub.subscribe('topic=ftrack.action.discover and source.user.username={0}'.format(self.session.api_user), self.discover) self.session.event_hub.subscribe('topic=ftrack.action.launch and source.user.username={0} and data.actionIdentifier={1}'.format(self.session.api_user, self.identifier), self.launch) def discover(self, event): items = [{'label': self.label, 'actionIdentifier': self.identifier}] return {'items': items} def launch(self, event): print "Launching the App" return { 'success': True, 'message': 'Action launched successfully.' } def register(session, **kw): if not isinstance(session, ftrack_api.Session): return action = TestAction(session) action.register() However, no new actions are showing in ftrack connect or when opened from the web interface. I have installed the api and am able to access ftrack using python in the command line. Is there something I'm missing to make the action work?