• Content count

  • Joined

  • Last visited

  1. Attach file in new note

    Thanks! Works like a charm!
  2. Failed to connect to event hub

    Testing again now and it works fine in Nuke/NukeStudio 11.2v1, but stopped working in Nuke 10.5.... I'll investigate further and write a support ticket, when I have time.. Thanks
  3. Failed to connect to event hub

    it connects without problems now ... no changes in the code or version of python - we're running python 2.7.11 code as following: session = ftrack_api.Session(auto_connect_event_hub=True) Might have been network shortage or something, but our IT guy diagnosed further and said there was no reply from the server, although FTrack in browser was working fine Cheers, Vit
  4. Attach file in new note

    Thank you, it worked!
  5. Failed to connect to event hub

    same here...
  6. Attach file in new note

    Hi there! How can I achieve the same thing with the new API, please? Thanks in advance! Vit
  7. @Mattias: Many thanks! @Remus: Original idea was just to simplify things - It takes care of making publish look like coming from the same username, which is logged on your system and you don't have to get the user API keys... if the system user and ftrack user names are matching ofcourse, so changing the name of the publish is hopefully just temporary patch
  8. Hello, I am trying to use dedicated API key, however I'd like to make publish look like it was done by a specific user. What's the best way of doing so? Thanks in advance! Cheers. Vit
  9. Slack User Group

    Hi Lucas, could I get the invite as well? Cheers,
  10. can't add the note

    Works now! Thanks Remus! Cheers
  11. can't add the note

    Hi there! I'm trying to add the note with API, but can't quite nail it - I'm basically taking code from the documentation and just replacing queries with my own .... , any ideas what I am doing wrong, please? Any advice appreciated! Cheers! Here is the code: category = session.query( 'NoteCategory where name is "External Note"' ).first() note = session.create('Note', { 'content': 'New note with external category', 'author': session.query('User where username is ""').one(), 'category': session.query('NoteCategory where name is "Internal"').one() }) task['notes'].append(note) session.commit() And the error # Result: ERROR 18:16:46.713:ftrack_api.session.Session(7088): Server reported error: ValueError(Cannot set relationship to string value.) Traceback (most recent call last): File "<string>", line 12, in <module> File "C:/Python27/Lib/site-packages\ftrack_api\", line 1238, in commit result = self._call(batch) File "C:/Python27/Lib/site-packages\ftrack_api\", line 1616, in _call raise ftrack_api.exception.ServerError(error_message) ftrack_api.exception.ServerError: Server reported error: ValueError(Cannot set relationship to string value.) based on code from API documentation here ( category = session.query( 'NoteCategory where name is "External Note"' ).first() note = session.create('Note', { 'content': 'New note with external category', 'author': user, 'category': category }) task['notes'].append(note)
  12. Solved -- typo in the code
  13. Hello folks, I'm trying to write a snippet to publish a file and link it to specific task and can't get it to work - is the TypedContextLink right way to do it? I've been doing quite some trial and error and getting error messages I don't quite understand ... could you point me in the right direction, please? Cheers!! import os import ftrack_api import ftrack_api.symbol #INIT SESSION session = ftrack_api.Session( server_url=server_url, api_key=api_key, api_user=api_user ) file_path = 'C:/Users/vit.sedlacek/' asset_name = "aaaW" asset_type = session.query( 'AssetType where name is "Upload"' ).one() ##------------------------------------------------------ ##musim dostat task a pak task ID project = session.query('Project where name is _PIPELINE').one() sqs = session.query('Task where is "{0}"'.format(project['id'])) #sqs.first()['name'] taskID = sqs.first()['id'] task = session.get('Task', taskID) shot = task['parent'] shot2 = session.get( 'Shot', shot['id'] ) asset = session.create('Asset', { 'name': asset_name, 'type': asset_type, 'parent': shot }) asset_version = session.create('AssetVersion', { 'asset':asset, 'task': shot, 'version': 110 }) session.create('TypedContextLink', { 'from': asset_version, 'to': task }) component = asset_version.create_component( path=file_path, data={ 'name': asset_name }, location=session.get('Location', ftrack_api.symbol.SERVER_LOCATION_ID) ) asset_version.encode_media( component ) session.commit()