Selected type is always Task
1 1

3 posts in this topic

Hello,

I'm new to Ftrack and I'm trying to write an action that displays info about what is selected (type, name, id etc). Mainly this is for us developers because I couldn't see a way to see the id of an object on the web front end.

The problem I'm having is that whatever I select returns task as the entityType, whether it is a task or not. If you then query the session with the correct type and the entityId, you get a result otherwise you get None. My workaround for this would be to query every type until I got a result but in order to that I need a list of object types. How can I get that?

Thanks,

Dan

Share this post


Link to post
Share on other sites

Hi Dan, the task is an legacy style notation for what we in the current API have as TypedContext.

To fetch a Task, Shot, Sequence, Folder, Milestone etc.. that are sub-types of the TypedContext you can use:

session.query('TypedContext where id is "{0}"'.format(entity_id)').one()

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
1 1