Lucas Correia

Administrators
  • Content Count

    209
  • Joined

  • Last visited

  • Days Won

    40

Reputation Activity

  1. Thanks
    Lucas Correia got a reaction from TDArlt in HTTP: Update task's status   
    The Python API Client often uses relationships (e.g. status) to update entities, but when using the raw API backend or the JS API client I recommend that you instead the relationship key attributes instead. In this case, that would be `status_id`.
    A more complete example of a request body would be:
    [ { "action": "update", "entity_type": "Task", "entity_key": [ "12bd29be-72b0-11e7-96a7-0a580ae40a16" ], "entity_data": { "status_id": "44dd9fb2-4164-11df-9218-0019bb4983d8", "__entity_type__": "Task" } } ] Regards,
    Lucas
  2. Like
    Lucas Correia got a reaction from Mike Choo in Transfered Client's feedbacks note can be check   
    Hi Emi,

    Thanks for the feedback!
    Currently it is only possible to mark new note as completable, but not a note written by a client when transferring it. 
    I agree that this would be a very useful feature and will bring it forward to the team.
    Thanks,
    Lucas 
  3. Like
    Lucas Correia got a reaction from Remus Avram in Date saved into DB when an entity is created   
    Hi Remus,

    We store an Event entity when some entities (e.g. Task, Note) are created. Examples of how to query these are available in this snippet.
    Currently, we do not track changes to AssetVersionLink and no create Event will be available. I've added a request to add this.
    Regards,
    Lucas 
  4. Like
    Lucas Correia got a reaction from laba Kumar Maharana in Images in session review   
    Including my answer to sati here as well for future reference:
    "Missing playable component" means that the version does not contain a component with the required metadata to mark it as a reviewable component.
    For local installations, we try to encode videos to a web playable format, but do not support encoding images at this point. To make the images viewable you can do one of the following:
    Publish versions that fulfills the requirement via the API: Publishing for web review Run an event listener which automatically updates images to be reviewable: Image 'encoder' for local installations. 
  5. Like
    Lucas Correia got a reaction from Remus Avram in no event emitted when create / delete / modify an entity type TypedContextLink   
    Hi,

    Sorry for the delayed response on this.
    I don't see a reason why changes to `TypedContextLink` shouldn't emit update events. I have added a bug task to look into this.
    Thanks for the feedback.
    Regards,
    Lucas
  6. Thanks
    Lucas Correia got a reaction from Tim Edelmann in publish custom events via javascript api   
    Hi,

    Thanks for reaching out.
    The JavaScript API does not automatically connect to the event hub. You can either call Session.eventHub.connect() or specify autoConnectEventHub when creating the session.
    Read more in the documentation: http://ftrack-javascript-api.rtd.ftrack.com/en/stable/handling_events.html
    Yep! Both are connected to the same event server and events will be available to either client.
    Regards,
    Lucas
  7. Like
    Lucas Correia got a reaction from Stanislav Kriuk in Time logging   
    Hi Chris,

    It should be possible to use an event listener to automate starting a timer for a user when a task's status is set in progress. The reason that we don't do this automatically is that there can be several situations where you do not want the timer started automatically, and it is hard to know when this is. 
    An event listener is a small python script that can be used to subscribe to changes in ftrack and perform custom logic such as updating a status, starting a external process or triggering a user interface. Here are some useful resources for setting up an event listener:
    * Developer hub with introduction to the API
    * How to subscribe with the API
    * Information about the update event
    * Example event listeners
    If you are not interested in logging time, but rather want to see how long a particular task has been in a certain state you can look at querying `Event` objects using the API. There is a snippet with some examples here. You probably want to query for action=change.status.task and parent_id=the task's id.

    Regards,
    Lucas
  8. Like
    Lucas Correia got a reaction from Remus Avram in Slack User Group   
    Invited.
    Regards,
    Lucas
  9. Thanks
    Lucas Correia got a reaction from Tim Edelmann in How to access custom attributes via javascript api?   
    Ah, I misunderstood the question somewhat. ftrackWidget.getEntity() will return an object as provided by the ftrack.wiget.update event. This reflects the currently selected entity in the project outliner to the left in the interface. The format is:
    { id: 'eb16970c-5fc6-11e2-bb9a-f23c91df25eb', type: 'TypedContext' } In order to get get an object which contains the custom attributes, you will need to use the id and type and query the API for information you are interested in.
    You can see an example of how this is done in ftrack-spark-base in ExampleContainer::onFtrackWidgetUpdate, which gets the name and link attributes. Here is where you would use the code in my last post to get the custom attribute value for the selected entity.
    Regards,
    Lucas
  10. Thanks
    Lucas Correia got a reaction from Tim Edelmann in How to access custom attributes via javascript api?   
    Hi Tim,
    In the javascript API, only attributes which you have selected using a projection will currently be available on the returned objects. In order to see what attributes are available, you need to look at the API schema (Session.schemas). Here is an example that does this using the Python API.
    Here is an example of how it can be used.
    /** Get custom attribute value for *entity* and *key*. */ function getCustomAttributeValue(entity, key) { const customAttribute = entity.custom_attributes.find( attribute => attribute.key === key ); if (!customAttribute) { console.log('Unable to find attribute', key); return null; } return customAttribute.value; } // Query custom attributes for a single Shot and print the fstart custom attribute value. session.query( 'select custom_attributes from Shot limit 1' ).then(function (response) { console.info( 'Custom attribute value:', getCustomAttributeValue(response.data[0], 'fstart') ); }); Regards,
    Lucas
     
  11. Like
    Lucas Correia got a reaction from Remus Avram in Create version 0 in Ftrack   
    Hi Remus,

    When creating a new version, it seems like `0` is treated as None and the resulting AssetVersion will have the version number set to the next available version number or 1. After the version has been created it is possible to update the version number to set it explicitly as 0.
    asset_version = session.create('AssetVersion', {...}) session.commit() asset_version['version'] = 0 session.commit() Regards,
    Lucas
  12. Like
    Lucas Correia got a reaction from Remus Avram in Query Calendar events   
    Hi Laura,
    Sure, they are exposed through the API as CalendarEvent and CalendarEventResource entities.
    Here is an example query to look if someone is booked on a particular project during an interval (in server time/UTC).
    session.query(     'CalendarEventResource '     'where calendar_event.project.name is "test" '     'and resource[User].username is "lucas.correia" '     'and calendar_event.start <= "2017-11-09T23:59:59" '     'and calendar_event.end >= "2017-11-09T00:00:00" ' ).first() Regards,
    Lucas
  13. Like
    Lucas Correia got a reaction from ChrisLynch in Time logging   
    Hi Chris,

    It should be possible to use an event listener to automate starting a timer for a user when a task's status is set in progress. The reason that we don't do this automatically is that there can be several situations where you do not want the timer started automatically, and it is hard to know when this is. 
    An event listener is a small python script that can be used to subscribe to changes in ftrack and perform custom logic such as updating a status, starting a external process or triggering a user interface. Here are some useful resources for setting up an event listener:
    * Developer hub with introduction to the API
    * How to subscribe with the API
    * Information about the update event
    * Example event listeners
    If you are not interested in logging time, but rather want to see how long a particular task has been in a certain state you can look at querying `Event` objects using the API. There is a snippet with some examples here. You probably want to query for action=change.status.task and parent_id=the task's id.

    Regards,
    Lucas
  14. Like
    Lucas Correia got a reaction from sschoellhammer in ftrack rv integration   
    Hi,

    If you are able to launch RV with the integration from ftrack Connect, but not via the review menu, that seems to indicate that either the legacy Python API or credentials has not been made available to the integration. See the getting started instructions here.
    No versions found seems to indicate that there are no versions published linked to the selected task. Can you try opening the Asset version directly, to verify if that works?
  15. Like
    Lucas Correia got a reaction from Remus Avram in Tracking in ftrack's Activities every ftrack entity change   
    Hi Remus,
    Thanks for the feedback.
    We have some plans to provide more extensive audit options in ftrack and extend the information available in the Activities tab.
    In the meantime, it is possible for developers to access more activity events through the API.
    Regards,
    Lucas
  16. Like
    Lucas Correia got a reaction from Remus Avram in Ftrack's front end stack   
    Hi Remus,
    The move to the new front-end stack will be an ongoing and progressive effort and you will start to see parts of the interface being updated or replaced over time. We started last year with releasing the Adobe integration built on a new front-end stack. After that, we have recently revamped planning and introduced studio-wide overviews in ftrack 3.5 which will be sharing with everyone soon (let us know via email on support [at] ftrack.com if you are eager to try these). Going forward, we will continue to replace parts of the interface with components using the new stack.
    There is also a bit of an update regarding the front end stack in this blog post.
    Regards,
    Lucas
  17. Like
    Lucas Correia got a reaction from Remus Avram in AssetBuild Custom Attributes   
    Thanks for following up.
    For future reference, the server version 3.5 requires ftrack-python-api 1.0.4 or higher. Version 1.0.3 will be unable to use custom attributes properly (what ionav experienced) and versions prior to 1.0.3 will fail to initialise the session with a ServerCompatibilityError. For more information, see the migration notes.
    We are still polishing a few things before we will start to roll out ftrack 3.5 to hosted sites and will be in contact before then.
  18. Like
    Lucas Correia got a reaction from Remus Avram in "Actions for >entity_type> <entity_name>" title in Actions Launcher   
    Thanks for raising the issue with the selection. It is unfortunate that the spreadsheets behave differently and I agree that the behaviour in the versions spreadsheet is more intuitive. I've added a ticket to look more at this issue to our backlog.
    Regards,
    Lucas 
  19. Like
    Lucas Correia got a reaction from Remus Avram in "Publish-> Linked to" browse not updated   
    Hi,

    The entity browser in ftrack connect will not automatically refresh when a new task is added, but there is a button which can be used to reload the data. It should be sufficient to press it in order to reload the view, let me know if this does not work for you.
     
     

  20. Like
    Lucas Correia got a reaction from Remus Avram in Add and get new component in the same session doesn't work   
    Hmm, I think I misunderstood the situation somewhat.
    You should be able to "refetch" a version's components by querying it again. For example:
    version = session.query( 'select components from AssetVersion where id is "{}"'.format( version['id'] ) ).one() However, there seems to be a bug which is preventing this from working properly. I've added a ticket which we'll take a look at soon.
    Regards,
    Lucas
  21. Like
    Lucas Correia got a reaction from Remus Avram in Event listener: Restrict task status updates   
    Hi,
    I've created an example event listener which can be used to restrict which users should be allowed to set certain statuses. I thought it would be useful for the rest of the community and wanted to share it here. Let me know if you have any questions or feedback.
     
    You can find the snippet on bitbucket.
     
    Event listener: Restrict task status updates
    The event listener can be used to limit which users are allowed to set certain statuses. When a status is changed in the ftrack interface, the event listener will check if the status is restricted, and if the user is member of the group with users that are allowed to set to those statuses. If not, the status will be reverted to the old value, and a message will inform the user that the operation was not permitted.
     
    Configuration
    To use the event listener, first set the two variables at the top:
    RESTRICTED_STATUSES
        A list of task status names that are restricted, only the members of a
        group will be allowed to change these.
    ALLOWED_GROUP_NAME
        The name of the group in ftrack which contains the users that are allowed
        to set the restricted statuses.
     
    Running the event listener
    You can run the event listener from the command line::
    python restrict_task_status_listener.py You can also register the event listener as a plugin. For more information, see the links below.
     
    Read more
    Find more information in our documentation:
    * Developing: Events
    * Event: Action - trigger interface
    * Event: Update
    * Managing statuses
    * Organizing users into groups
    * Python API: Configuring plugins
    * Python API: Environment variables
  22. Like
    Lucas Correia got a reaction from Remus Avram in 'versions' attribute for AssetBuild Type   
    Hi Remus,
    To get all versions, you will first need to go over all Assets.  See the diagram on this article in the documentation for a better understanding.
     
    Here is an example where I query for the link attribute on each version for the first asset build which has any assets. The select part of the query can be omitted, but can improve the performance significantly when working with nested relationships.
    >>> asset_build = session.query('select assets.versions.link from AssetBuild where assets any()').first() >>> for asset in asset_build['assets']: ... for version in asset['versions']: ... print [item['name'] for item in version['link']] ... [u'Project', u'My Asset Build', u'check v1'] [u'Project', u'My Asset Build', u'check v2'] [u'Project', u'My Asset Build', u'pattern v1']  
    Regards,
    Lucas
  23. Like
    Lucas Correia got a reaction from Fredrik Limsater in Event listener: Restrict task status updates   
    Hi,
    I've created an example event listener which can be used to restrict which users should be allowed to set certain statuses. I thought it would be useful for the rest of the community and wanted to share it here. Let me know if you have any questions or feedback.
     
    You can find the snippet on bitbucket.
     
    Event listener: Restrict task status updates
    The event listener can be used to limit which users are allowed to set certain statuses. When a status is changed in the ftrack interface, the event listener will check if the status is restricted, and if the user is member of the group with users that are allowed to set to those statuses. If not, the status will be reverted to the old value, and a message will inform the user that the operation was not permitted.
     
    Configuration
    To use the event listener, first set the two variables at the top:
    RESTRICTED_STATUSES
        A list of task status names that are restricted, only the members of a
        group will be allowed to change these.
    ALLOWED_GROUP_NAME
        The name of the group in ftrack which contains the users that are allowed
        to set the restricted statuses.
     
    Running the event listener
    You can run the event listener from the command line::
    python restrict_task_status_listener.py You can also register the event listener as a plugin. For more information, see the links below.
     
    Read more
    Find more information in our documentation:
    * Developing: Events
    * Event: Action - trigger interface
    * Event: Update
    * Managing statuses
    * Organizing users into groups
    * Python API: Configuring plugins
    * Python API: Environment variables
  24. Like
    Lucas Correia got a reaction from Mike in Photoshop extension installation error   
    Hi Mike,
    Sorry to hear the installation is not working for you. Unfortunately, the error messages from Adobe does not clearly indicate what the issue is.

    ftrack_connect_photoshop_0.2.3.zxp contains an older version of the integration with less functionality. It is not compatible with CC 2015.5.  The new integration is distributed as ftrack connect adobe and is the same for all CC apps.
    The newest version is now available from Adobe add-ons, so you can try using that instead (though I suspect you'll run into the same issue).
    Adobe has a troubleshooting guide for extensions which may be useful. It contains a checklist of things you can verify, see Troubleshooting guide for Adobe Add-ons.
    Regards,
    Lucas
  25. Like
    Lucas Correia got a reaction from Mike in New API: Query entity type   
    Hi Mike,
    There is two abstract types in the API schema which represent objects in the project hierarchy.
    Context - Can be either a Project, or a TypedContext TypedContext - An object in the project hierarchy: e.g. a Folder, Task or Sequence. A TypedContext will have a object_type relation to an ObjectType entity.  This entity will in turn have some information about which kind of object it is. The object_type information is used behind the scene to generate the dynamic types in the API.
    Below is an example how you can use this information:
    >>> sequence = session.query('Sequence').first() >>> print sequence.entity_type Sequence >>> print sequence['object_type']['name'] Sequence >>> print isinstance(sequence, session.types['Sequence']) True  
    Regards,
    Lucas