• Content Count

  • Joined

  • Last visited

  1. Hi , I'm basing my code on this cascade status changes hook: https://bitbucket.org/ftrack/ftrack-recipes/src/master/python/events/cascade_status_changes/hook/status_listener_hook.py I have the following function that I use to update the status of an "Asset Configuration" entity automatically, it returns the status of the "from entity" of an incoming link: asset_configuration_states = ['IN_PROGRESS', 'NOT_STARTED', 'CANCELLED', 'DONE'] def get_state_name_asset_configuration(link): '''Return the short name of *link*'s state, if valid, otherwise None.''' try: state = link['from']['status']['state']['short'] print link['from']['name'] print state except KeyError: logger.info(u'Child {} has no status'.format( ftrack_api.inspection.identity(link['from']) )) return if state not in asset_configuration_states: logger.warning(u'Unknown state returned: {}'.format(state)) return return state If all the links return DONE then I also update the Asset Configuration to DONE. It seems however that sometimes this function returns the old state of these "from entities" and not the new updated one. An example: I have an "Asset Configuration" entity with 5 incoming links. 4 of these incoming links have as status DONE, and I change the status of the 5th incoming link from IN_PROGRESS to DONE as well. This triggers the call of the get_state_name_asset_configuration() function which should now only return DONE for all the incoming links, however the 5th link still has as its state IN_PROGRESS. I have a similar function for a Shot that checks the status of its sub-tasks just like in the status_listener_hook.py file, and that one works when checking the status of a task. Is the problem that I'm checking the status through a link, and this isn't updated yet at the time of checking? If so is there a way to force them to update before I call this function? Edit: after doing some testing it seems to me that Tasks do return their correct status, but entities like Folders/Shots/Sequences do not (they still return their old non updated Status)?
  2. Hello , Is it possible to link a certain version of a folder to another entity? Currently I have a folder containing some tasks, and I link that folder to my custom entity. I am now creating versions for the task folder, and would like to 'pin' a certain version to my custom entity. When looking at the incoming links in my custom entity, I would like to know which version of the Task Folder was linked. Is this concept possible to do through the API?