• Content Count

  • Joined

  • Last visited

  • Days Won


Tilt last won the day on March 14 2017

Tilt had the most liked content!

About Tilt

  • Rank
    Advanced Member

Recent Profile Visitors

798 profile views
  1. We're running Centos 7 which has a python version that identifies as 2.7.5 (even though it probably contains many backported patches from later versions). Unfortunately, this prevents us from using pip to update ftrack-python-api from 1.8.0 to 1.8.1. (the previous version didn't have the requirement of Python >=2.7.9). Is there something in 1.8.1 that warrants the minimum Python version? I'll download it manually for now to see if it works...
  2. Sorry to hijack this thread, but we're currently experiencing the same exception (IntegrityError(A note message must have recipients)). However, I'm not creating a note entity myself, I'm using .create_note on an AssetVersion or a Shot entity. Unfortunately, it pops up only now and then in an action handler so it's hard to debug. When I restart the event hub it works perfectly, when I call the event handler as a stand-alone python script after that error has happened everything works fine. So the only thing I was able to do until now was print lots of debugging output. Before the note gets created, the session isn't new but it doesn't have any pending operations (session.created/modified/deleted are empty according to my logs). The note gets created on an AssetVersion using create_note(). I supply an author and a category. Next, I set metadata on the newly created note and I modify its date (my code transfers notes from a client's Shotgun to our ftrack.) The session's operations are now: created: [<dynamic ftrack Note object 49129808>, <dynamic ftrack Metadata object 49129104>], modified: [<dynamic ftrack AssetVersion object 37916368>], deleted: [] Then the commit happens which sometimes throws that IntegrityError. In the exception handler I've done some digging around to figure out if that note object differs from other newly created notes where the exception doesn't occur. The only thing I've noticed is that parent_id and parent_type of that new note are "NOT SET" even though the new note object is part of the asset versions's ["notes"] list. Could that be the reason? The weird thing is that like I said it's hard to debug. Restarting the script so it gets a new session and re-running the whole thing has always fixed things so far.
  3. I'll give it a try! Thank you.
  4. Sorry to resurrect this old thread... getDefaultRecipients was a really nice thing in the legacy API. We're searching for a workaround for this use case: A note should get created on an asset version but not only the default recipients should get it. For example, we might want notes to a lighting task asset version also be sent to the artist assigned to the comp task. Previously, I used the result from getDefaultRecipients (which included all managers) and added the user that was assigned to comp. Now that is no longer possible, because create_note() will override the default recipients if I manually add some. Managers are also not implemented in the new API yet (and I remember reading that it's not on the todo list) so I can't just add the managers in the create_note() call myself. Are there any workarounds? Is it possible to somehow "trick" ftrack into considering a certain user as part of the default recipients? Maybe using links? cheers Stefan
  5. Hi, I'm experiencing strange errors in our event handlers and actions. They are hard to replicate and sometimes restarting the event hub and the handlers works, but sometimes it doesn't. I tried to get the thumbnail URL as described in the API docs (currently running 1.4.0) http://ftrack-python-api.rtd.ftrack.com/en/stable/example/thumbnail.html#example-thumbnail-url When calling get_thumbnail_url, I get this error: AttributeError: 'Location' object has no attribute 'get_thumbnail_url' Printing the location object in fact prints this: <Location(3a372bde-05bc-11e4-8908-20c9d081909b)> That's ftrack_api.symbol.SERVER_LOCATION_ID, but the type is just "Location". When I try the session.get("Location",...) line on another machine, this returns <ServerLocation...> and I can call get_thumbnail_url without problems. I then tried to replace the session.get(...) with session.query("Location where id=...") and get_thumbnail_url with just get_url(). Now this exception is raised in ftrack's api: File "/path/to/site-packages/ftrack_api/entity/location.py", line 607, in get_url return self.accessor.get_url(resource_identifier) AttributeError: 'Symbol' object has no attribute 'get_url' The "Symbol object has not attribute xyz" has occured before when calling get_filesystem_path on an ftrack.unmanaged location: File "/path/to/site-packages/ftrack_api/entity/location.py", line 583, in get_filesystem_path return self.get_filesystem_paths([component])[0] File "/path/to/site-packages/ftrack_api/entity/location.py", line 592, in get_filesystem_paths self.accessor.get_filesystem_path(resource_identifier) AttributeError: 'Symbol' object has no attribute 'get_filesystem_path' What could be causing this?
  6. sorry, late reply. Thanks, it works as expected by default :-)
  7. I'm migrating our last bits of code from the old API to the new one. Is there a replacement for .getDefaultRecipients() when adding notes to asset versions? That function seems to be missing. Do I just look for all users assigned to the task and add them as recipients manually? cheers Stefan
  8. Tilt

    moving TimeLogs

    worked like a charm!
  9. Tilt

    moving TimeLogs

    Thank you! I'll give that a try
  10. Tilt

    moving TimeLogs

    I want to move all the timelogs from one task to another task in another project because I want to recreate a project with a dedicated project schema. If I could just change the schema using the new python API that would be great but I think that's not possible so I just created a new project and created new tasks in the browser. But now I want to move timelogs to the new tasks so I can remove the old project from ftrack. My first thought was to just get a timelog from the old task, then append it to the new task's timelogs. But since a TimeLog references a specific context_id I don't know if that's wise or even supported. I wanted to ask how to do it before I do something that might mess with the database in unintended ways: for timelog in old_task["timelogs"]: new_task["timelogs"].append(timelog)
  11. I'm having trouble understanding the use of "has" and "any" as it is described in the api docs at http://ftrack.rtd.ftrack.com/en/stable/developing/api/query_syntax.html#filtering-on-relationships The example for "has" is: select id from Note where author has (first_name is "Jane" and last_name is "Doe") and the text states that writing that query without "has" wouldn't have the desired effect of returning notes from Jane Doe. But why is that? The way I would write this query without "has" would be: select id from Note where author.first_name is "Jane" and author.last_name is "Doe" How would this query return notes by "Jane Smith" or "John Doe"? I'm having trouble following along. I now I could play around with queries on our server but I don't really know what a correct result would look like so I'm asking this on the forum instead :-)
  12. Hi, is there a way to get all the custom_attributes in a query or a session.populate() call? I can do session.query("select custom_attributes from Shot where ....") but when I check the values with "auto_populating False", they are mostly Symbol(NOT_SET), except for default values. I can't do "select custom_attributes.fstart from Shot where ..." because that throws ftrack_api.exception.ServerError: Server reported error: KeyError(u'fstart') as does session.populate(shot, "custom_attributes.fstart") The reason I'm asking is that I usually need a bunch of custom attributes so I want to speed things up and reduce queries.
  13. Tilt


    Is there a replacement for project.createManager() in the new API?