Yas Opisso

Members
  • Content Count

    8
  • Joined

  • Last visited

About Yas Opisso

  • Rank
    Newbie

Profile Information

  • Gender
    Female

Recent Profile Visitors

374 profile views
  1. 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.
  2. 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()
  3. Yas Opisso

    sessions

    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.
  4. # 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']
  5. Yas Opisso

    Get Thumbnail Url

    Has a "not so hacky" way of doing this been implemented in the new api?
  6. 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
  7. 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)
  8. 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