eight

Members
  • Content Count

    50
  • Joined

  • Last visited

  • Days Won

    3

eight last won the day on February 14 2017

eight had the most liked content!

About eight

  • Rank
    Advanced Member

Recent Profile Visitors

527 profile views
  1. I found the proxy location documentation from efestolab. Although it's helpful, it looks like it's meant to filter by Task Types and Component Types rather than by Project. I think I can base something off that, but it would be better to have this kind of thing already built into ftrack Connect.
  2. Is it possible to choose the root directory on a per project basis? We have a studio with multiple file storages paths, and we want some projects to go on one file storage and other projects to go on a different file storage. For example: City1 - Storage1 - Storage2 City2 -Storage1 -Storage2 If I want to work on Project1 in City1, Storage1 and City2, Storage1, but I want to work on Project2 in City1, Storage2 and City2, Storage2. What's the best way to do this?
  3. eight

    New API: getTasks

    Thank you for the reply. It helps.
  4. eight

    New API: getTasks

    Forgot to mention using includeChildren=True.
  5. You could try session.populate(tasks, 'name,status.name,assignments.resource') instead. I know if you use assignments.resource.name it will break even though it seems like it should be valid. So you can always add name as a default projection for Task similar to this example: Default Projections
  6. eight

    New API: getTasks

    Any way to create the equivalent of Task.getTasks in the new API? I could recursively get children of children, but that seems pretty slow.
  7. You can use both APIs together, so if there is something you cannot do with the new API, you can just fall back on the old API. I don't know where to find extra tutorials, but ftrack has a public bitbucket account with some examples you can study. Most of them seem to be using the old API though.
  8. Hi, When, I'm looking in ftrack web in the Tasks view, I want to add a column for a custom attribute, but it looks like it's not there. I can see some of my custom attributes, but it seems that only custom attributes that are not hierarchical are shown. How can I show these attributes?
  9. Is there an easy way to query an entity from an event? My problem is that each item in event['data']['selection'] contains an 'entityType' which is 'task' whether it is a Task, Shot, Sequence, etc. So I don't know whether to do session.get('Task', id), session.get('Shot', id), session.get('Sequence', id) or whatever it might be. How do I know what the actual type to query is?
  10. So you mean the cache maker would look like this? def testCacheMaker(session): return ftrack_api.cache.MemoryCache() I get very similar performance as not using a FileCache. Also, I forgot to mention that I was deleting the file that the FileCache made before each run.
  11. I have another update. The missing select statement was only a part of the problem. The rest was because of FileCache. I tried the example below with and without the session cache (183 tasks). With the cache, it took about 13 seconds, and without, it took about 4 seconds. The big difference showed when adding a lot of select statements. With select statements + cache, it took about 35 seconds while select statements without cache took about 6 seconds. import os import time import tempfile import ftrack_api def testCacheMaker(session): testCachePath = os.path.join(tempfile.gettempdir(), 'ftrack') try: os.makedirs(testCachePath) except: pass testCachePath = os.path.join(testCachePath, 'test_cache.dbm') print 'testCachePath: {}'.format(testCachePath) return ftrack_api.cache.SerialisedCache( ftrack_api.cache.FileCache(testCachePath), encode=session.encode, decode=session.decode ) def test(): start = time.time() session = ftrack_api.Session(cache=testCacheMaker) query = 'User where username is "fred"' user = session.query(query).one() query = 'Task where project.status is active and assignments any (resource_id={})'.format(user['id']) tasks = session.query(query).all() print len(tasks) print 'time: {}'.format(time.time() - start)
  12. I realized my problem while I was trying to create an example for you. I was looping through each task and accessing a key that wasn't projected making it a lot slower. It was for parent.type.name. Yet, I can't select this because I get a ServerError. It must be similar to the problem deex had. Here's the example code if you still want to see it: session = ftrack_api.Session() query = 'User where username is "fred"' user = session.query(query).one() query = 'Task where project.status is active and assignments any (resource_id={})'.format(user['id']) tasks = session.query(query).all()
  13. It turns out that getting all tasks for a user is very slow, even if I filter out projects that are no longer active. It's taking about 45 seconds to load for someone with 181 active tasks. Is there a way to make it faster or is this just an inherently slow query? I've tried two different ways. One is the way I did it in a previous post in this thread, and the other way is the way that Mattius did it. They both are similar in time.