Jump to content

"_getApplicationEnvironment" doesn't give correct entity type ?


YuChen

Recommended Posts

Hi all,

http://ftrack-connect.rtd.ftrack.com/en/stable/developing/tutorial/custom_applications.html

I'm working on a custom application launcher mention in above link and noticed that "_getApplicationEnvironment" seems like not provide correct entity type for selected enity (in ftrack studio Web page). When I query entity type like this:

def _getApplicationEnvironment(self, application, context=None):
    ...
    if context['selection']:
        entity_id = context['selection'][0]['entityId']    # entity ID is connect

        entity_type = context['selection'][0]['entityType']    # but entity type always return "task"

I always got "task" for entity type. Should't it be the type corresponding to my selection :huh:

Link to comment
Share on other sites

  • 1 month later...

Hi @Lorenzo Angeli

Since "context['selection'][0]['entityType']" always gives out "task" string (only "assetversion" and "show" can be correctly recognized), the command you provided doesn't really work (test with ftrack-connect-package-1.1.2 & ftrack-connect-2.0.0 rc3). I think maybe some fixing are necessary forthis issue:
1. "context['selection'][0]['entityType']" need to provide correct selected entity type.
2. "context['selection'][0]['entityType']" need to provide a string started with capital letter.

Now the "context['selection'][0]['entityType']" gives "task" which is started with lowercase alphabet and it can't be used directly in "session.get" function:
my_selection = self.session.get( 'task', 'task_id' )    # This doesn't work
my_selection = self.session.get( 'Task', 'task_id' )    # This works

Not sure whether it's a bug or not  but I guess these fixing could make workflow more fluent :)

Link to comment
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
×
×
  • Create New...