Jump to content

Action - get right entity type using ftrack_api


Remus Avram

Recommended Posts

I am running a action on a sequence, shot, task and I get for all 'task' entity type.

How can I get the right entity type using the ftrack_api in an action?

def launch(self, event):
    '''
    @param event: ftrack event
    '''
    user_id = event['source'].get('user', {}).get('id', None)
    data = event['data']
    selection = data.get('selection', [])
    entity_type = selection[0]['entityType']
    entity_id = selection[0]['entityId']

    print entity_type

Link to comment
Share on other sites

How can I get the entity in the ftrack_api if the ftrack type is tempdata?

Example:

legacy api:

temp = ftrack.TempData(id='becd972a-7a77-11e6-be67-005056a76761')

I tried this in the ftrack_api:

entity = session.get('TypedContext', "becd972a-7a77-11e6-be67-005056a76761")

but it returns None.

Thanks for the support!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...