• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Tilt

  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?
  14. Hi, I've tried to follow the example in the api docs on how to add attachments to jobs. However, I'm receiving a weird error. My code: job = session.create('Job', { 'user': user, 'status': 'running', 'data': dumps({'description': 'test job'}) }) server_location = session.query('Location where name is "ftrack.server"').one() component = session.create_component( logfile, data={'name': 'My FileName'}, location=server_location ) session.create( 'JobComponent', {'component_id': component['id'], 'job_id': job['id']} ) I receive an error in create_component: LocationError: Failed to register components with location <Location("ftrack.server", 3a372bde-05bc-11e4-8908-20c9d081909b)> due to error: Server reported error: PermissionError(Permission denied: not allowed to 'update' 'User'. Missing the required 'Manage users' permission.) Transferred component data that may require cleanup: [(<dynamic ftrack FileComponent object 25089360>, 'bdad7a2b-9d64-413d-be37-4a9b3dcf7ad4')] I'm using an API key that doesn't have the "Manage Users" permission. I can grant them but I'm curious as to why this error happens and why creating the component needs user management permissions in the first place.
  15. Hi! We're encoding our own h264/webm clips for review based on the ffmpeg command that is mentioned somewhere in the API docs. Everything works great but I was wondering if there's documentation about the commands that are used when using ftrack's own encoding capabilities. I've noticed that there's a quality level to choose from in the ftrack settings. Is this just increasing the bit depth or are there other ffmpeg features at work? I'm asking because you guys have probably already experimented with the dozens of h264 parameters that you can pass to ffmpeg and figured out a way to achieve good results while I would have to spend hours upon hours browsing video codec forums to even understand how all of this works ;-)
  16. never used it...but I remember having seen "dependency" functions in the API docs..
  17. Tilt

    new ftrack_api

    Thanks, Carl!
  18. Tilt

    new ftrack_api

    Hi, I've read on the migration and release notes page that there's a new API in beta. It seems to change things quite a bit, with session objects? Could you please elaborate a bit about that development? Basically I just want to make sure that our custom stuff continues to work when we get upgraded to 3.1 (currently on It's hard to keep up with the api docs because I get lost a lot in there... the new ftrack_api package seems to follow a different version numbering scheme. And links from the release notes seem to end up on pages that I have a hard time finding again using the hierarchy on the left... :-)
  19. Hi, is there an event when a new component is created on an AssetVersion? The first time an AssetVersion is published, I get an update event on its ispublished attribute. We have created a custom publishing tool that allows artists to add components to an already published version (for example when the preview movie/jpeg of an exr sequence has been rendered) but there's no way to react to that. I could make our tool set a dummy attribute on the AssetVersion so I get an update event... but that seems like a hack :-) edit: just saw that this is answered here: http://ftrack.rtd.ftrack.com/en/latest/developing/events/overview.html#publishing-events however, we're still using the ftrack.unmanaged location... that seems to explain why it doesn't fire an event.
  20. Hi Mattias, yes, that's the reason. cheers Stefan
  21. To solve this in our pipeline, we have written a custom script to publish assets to Ftrack. Using the Python API, you can create an AssetVersion object and before publishing it you can overwrite the version number that ftrack suggested with whatever number you want (for example based on the file name).
  22. I was trying to create an "offline" list of user names so I can use it elsewhere without querying ftrack all the time (render manager interface, etc...).
  23. The "Time Reports" feature is a great way to get an overview of the working hours. We've noticed, however, that there's no way to see which shot an artist has worked on. Only the task type. So our producer asked us to add the shot number as a comment to our time logs. But this seems weird, because when we're entering working hours, the list clearly shows Project/Sequence/Shot/Task. But the pdf report omits this information. Are we looking in the wrong place for that (after all there are several kinds of reports) or is it simply not possible to have sequence/shot numbers in the time report pdf? cheers Stefan