Yas Opisso

  • Content Count

  • Joined

  • Last visited

About Yas Opisso

  • Rank

Profile Information

  • Gender

Recent Profile Visitors

409 profile views
  1. If you want to go directly through the project, you can look at its "assignments" key. You can tweak the code above to query Assignment instead of Task. Edit: Although to be fair I'm not sure the "assignments" key in a project will give you assignments for every children. I don't believe the project has assignee so it might work. I haven't tried doing so this way.
  2. Here is a quick example; let's suppose you have the user ID and you need to find out the list of projects he/she has assigned. session = #<build your session here> user_id = '805cf360-115e-11e5-ax81-002593f15914' # This query looks at active projects only task_query = 'select project.id, project.name, project.full_name from Task where project.status is active and assignments any (resource_id={})'.format(user_id) ft_tasks = session.query(task_query).all() for task in ft_tasks: project_id = task['project']['id'] project_code = task['project']['name'] project_name = task['project']['full_name'] print(project_code, project_name, project_id)
  3. What's your end goal? Find a list of projects that user X is assigned to? If so I would instead query the assignments for the user and find the project from there.
  4. If you don't want Ftrack to manage the locations for you, you could use the ftrack.unmanaged location and publish the files using that location. You can query the location like this: location = session.query('Location where name is "ftrack.unmanaged"').first()
  5. Hi, I would change the Asset query from .one() to .first() if you leave .one() it will complain that the Asset doesn't exist (ftrack_api.exception.NoResultFoundError), setting it to .first() will return None which will properly trigger your if not asset: code block. There should only be one Asset with the same name under the same parent so .first() should work just fine. If you still need to set the version numbers yourself (at times we do that to make sure that the version has the same number that the component published) and you want to avoid duplicate errors, much like what you did with the Asset, you can query the AssetVersion with the specific version number under the same asset and see if it returns a value. If it does you could either notify the user that a previous version exist, and perhaps as if overwriting is desired (this can be dangerous but useful at times). As a side note, on the code you provided you are setting the value of asset_version the first time to a query that returns the first entry it finds under the asset, than overriding it with a new AssetVersion entity you create.
  6. Here's a quick snippet for you. import ftrack_api # Your info goes here session = ftrack_api.Session( server_url='http://your.server.com', api_key='11111111-22222-33333-44444-5555555555555555', api_user='yourusername' ) # Queries all priorities (so you can know their names/values/id etc) priorities = session.query('Priority').all() for p in priorities: print p.keys() # Queries a priority by name priority_name = 'Extreme' # 'Low, Medium, High' priority_extreme = session.query('Priority where name is "{}"'.format(priority_name)).one() # Queries a task/entity ftrack_task_id = 'a2db5442-8c56-11e8-83ac-0cc47adee6c0' ftrack_entity = session.query('Task where id is "{}"'.format(ftrack_task_id)).one() # Set's the priority ftrack_entity['priority'] = priority_extreme # Commits the changes session.commit()
  7. Yas Opisso


    Hi @pawel: As for the ftrack issue in Maya, are you using Maya 2017? If so, Maya 2017 update 4 seemed to fix this issue for me.
  8. # This will query all the users. Uncomment the print statement # if you want to see what keys are available to the entity users = session.query('User').all() for user in users: # print user.keys() print user['username'] # If you know what values you need you can use select to speed things up # Carefull, too many selects can actually slow you down on large queries users = session.query('select username from User').all() for user in users: print user['username'] # Ultimately if you want to query a specific user here's how you do it. # Replace JDoe with the actual user name. users = session.query('User where username is "{}"'.format(JDoe)).all() for user in users: print user['username']
  9. Yas Opisso

    Get Thumbnail Url

    Has a "not so hacky" way of doing this been implemented in the new api?
  10. Hi Henrik, Just FYI you can also query the tasks of a specific user by getting the user and then getting his/her tasks. user = ftrack.getUser ('UserName') # This gets the usertasks = ftrack.getTasks(user) # Gets the current tasks for the particular user from here you can get the task statuses by: task[0].getStatus().get('name') PS: I don't realized you answered this already
  11. Hi guys, I'm having this issue with connect. It won't open up. I uninstalled it and re-installed several times with no luck. Any Ideas? File "C:\Program Files\ftrack-connect-package\library.zip\cx_Freeze__init__.py", line 29, in <module>File "C:\Program Files\ftrack-connect-package\library.zip\ftrack_connect_package__main__.py", line 70, in <module>File "C:\Program Files\ftrack-connect-package\common.zip\ftrack_connect\__main__.py", line 77, in main theme=namespace.themeFile "C:\Program Files\ftrack-connect-package\common.zip\ftrack_connect\ui\application.py", line 83, in __init__ self.login()File "C:\Program Files\ftrack-connect-package\common.zip\ftrack_connect\ui\application.py", line 138, in login self.loginWithCredentials(server, username, apiKey)File "C:\Program Files\ftrack-connect-package\common.zip\ftrack_connect\ui\application.py", line 194, in loginWithCredentials self.configureConnectAndDiscoverPlugins()File "C:\Program Files\ftrack-connect-package\common.zip\ftrack_connect\ui\application.py", line 201, in configureConnectAndDiscoverPlugins ftrack.setup()File "C:\Program Files\ftrack-connect-package\common.zip\FTrackCore\__init__.py", line 147, in setup EVENT_HANDLERS.discover()File "C:\Program Files\ftrack-connect-package\common.zip\FTrackCore\api\registry.py", line 54, in discover .format(modulePath, error)
  12. Hi, When I right click on an task, Photoshop is the only software that's available in the Actions menu. Any Idea about what is it I'm missing? The hooks are installed (Nuke in my case). Also, is there any other way I could Implement the plugging in Nuke without calling it from FTrack? Thanks in advance. PS: I have nuke 9.0v5 & 8.0v6 installed