Jakub Trllo

  • Content Count

  • Joined

  • Last visited

About Jakub Trllo

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi @Steve Petterborg, any progress? We found another reason why we need server's current time (in UTC format), we want to be able create timelogs for specific hour and minute. That is totally impossible without knowing server's (or database's) time right? Jakub
  2. Hi Steve Petterborg, sorry for not enough info. No, server is not installed locally and don't know how to find out if it is cloud instance? (`pype.ftrackapp.com`) No, timer is not started with web UI, but with python API, through user entity's method `start_timer()`, with that approach web UI shows timer started, on our server it is 1 minute ago, so web ui timer shows -60 seconds(and counting to 0 second and beyond). But in my case of our server start/stop of timer through the web UI works perfect, don't know if other clients found these issues. BTW: When I checked Timer creation event, it really shows that `start_time` value is offset (at least to my `arrow.now()` value), but I would expect it doesn't matter if my current time is offset, because python API does not set that `start_time` value. REASON: I expect that `start_time` value is set by the server, which means that the server has offset system time. If there is ability to query server's current time it is easy to find out delta and override `start_time` value with right value. Jakub
  3. Hi, we've got issues with starting timer of users. In most of cases start of timer is offset by 1 minute apart, but we have reported issues that timers are offset more than tens of minutes. With ability of getting server time this would not be issue at all. With server time delta it is easy to start timers or add/edit timelogs withit API. Is that possible now? Thank, Jakub Trllo
  4. Maybe Bug Report: Now I've found out that those custom attributes which were not found in "CustomAttributeValue" can't be set with API. When I try to set them in session, PermissionError is raised on commit, but Web app shows me that I have permissions. Exception: ftrack_api.exception.ServerError: Server reported error: PermissionError(Permission denied: not allowed to 'create' 'Variable_Value'. Missing the required 'Pixel aspect write' permission.) EDITED: This started to happen yesterday and yesterday was our Ftrack updated to version 4.3, does it mean it has changed something on server side for custom attributes we should know, it is a bug or It's just our mistake?
  5. I'll just add one more info for those who may want do something similar. It is better to not use "CustomAttributeValue" table but "ContextCustomAttributeValue" in the query because CustomAttributeValue does not contain all data for all custom attributes. (Not sure why maybe someone from Ftrack may answer?) session.call([{ 'action': 'query', 'expression': ( 'select value, entity_id from ContextCustomAttributeValue' 'where entity_id in ({0}) and configuration.key is "{1}"' .format( ', '.join( ['"{0}"'.format(entity_id) for entity_id in entity_ids] ), attribute_name ) ) }])
  6. Hi, I'll extend the question. Is possible to set custom attributes for multiple entities at once? ISSUE: I have dictionary where key represents id of ftrack entity and value represents a value of one specific custom attribute. I would like to set them all at once (or as fast as possible in other words). NOTE: I have also ftrack entities at the moment I need to change values of the custom attribute. But when I'll use `entity["custom_attributes"]["{specific_key}"] = value` to change value it takes on average 0,2 second (60 seconds for whole project). It's probably because every time is used `custom_attributes` key on entity, api is querying values of custom attributes? I assume that it is not possible to use UPDATE of INSERT queries, right? Thanks, Jakub EDITED: Found out that session has recorded_operations where I can put UpdateEntityOperation. With this it takes less then 0.1 for whole project, GREAT Is this usage "kosher"?
  7. Hi, I think one pssibility is to use "hidden" item in interface items (http://ftrack.rtd.ftrack.com/en/stable/developing/actions.html#hidden), where you can store if you are in widget A or widget B so you can regonize from "values" of event which values are you procesing at the moment. Another possibility is to register multiple callbaks. Callback A will always trigger callback B but if item is Sequence then will trigger mid-widget. Example c ode in attachment (not tested nor runned!). Jakub example.py
  8. Jakub Trllo

    Faster querying

    Hi, I have a question: Is there any faster possibility of getting all entities from project than with code below? ```PYTHON # ft_project_id - Project's ID entities_query = ( "select id, name, parent_id, link, custom_attributes" " from TypedContext where project_id is \"{}\"" ) all_project_entities = session.query( entities_query.format(ft_project_id) ).all() ``` It's actually pretty fast (0.027s/entity) but with 4500 entities in project it takes 2 minutes. EDITED: Found out that when custom_attributes are not in query it is much faster (from 2 minutes -> 6 seconds), so it was my fault. Thanks, Jakub
  9. Hi, Thanks! That is very helpful snippet. I have addition question: We need to get all hierarchical values for each entity in project, with this snippet it will probably take ages... Is possible to modify query to be able get values for multiple entities and custom attributes at once. Or when we'll add more query actions to `data` argument to `session.call` method they'll be processed without request to ftrack server for each entity and custom attribute? EDITED: I've modified the query to get all at once and it actually works and returns only data of really set entities. So now I only have to go through parents and find values of attributes that are not set, so I'm happy now. Thanks again Jakub
  10. Hi, have this issue any progress? Any suggestions how hierarchical custom attributes may return expected values or "real" values (not default) through ftrack API? Thanks, Jakub Trllo
  11. Hi, >> If you want it to return None, you simply have to leave the default value empty, tested now and seems to be working as expected. That's what we are recommending now but our clients mess it up sometimes. >> Setting the default value on the custom attribute indeed override the None if the value is not set, that's what is for. I expect the same `only` if it is not hierarchical attribute - hierarchical attributes should have different properties in API because they have different properties in web app and I don't want to get default value if any of parents value is set. Or better I want to get default value of hierarchical attribute only on project entity if do not have set it because that's top entity. On lower entities doesn't make sence return default value because may return nonsence data (like in example upwards). Exist a way how to get information about custom attribute is set or not on entity? Special query or something? That's all I need at the moment... Thanks, Jakub
  12. Hi, I hope this issue is not caused because we don't have newest ftrack_api version and please let me know if we're handling with old issue. Hierarchical custom attributes makes us unhappy at the moment. Api do not return `None` if default value is set which breaks everything with hierachical attributes for us. Example: Hierarchical Custom attribute `hier_attr` with default value `100` in hierarchy: - project_xy - `hier_attr` is set to `50` / API will return `50` -- hier_1 - `hier_attr` is set to `200` / API will return `200` --- hier_1_1 - `hier_attr` is not set / API will return `100` If value is not set, `None` should be returned (which is acceptable possibility), or `200` in this case and only if all parents don't have set that custom attribute's value then default should be returned like values in web app. Second variant is better for us, but first one also make sence and meets the documentation. Is that possible? Thanks, Jakub Trllo
  13. Hi, Yes but it is strange for me because it is 1 frame more. E.g. mov with 120 frames has `frameIn = 0` and `frameOut = 120` which makes 121 frames (with my logic). But it works, Thanks. Jakub
  14. Hi @Remus Avram, may I ask what was the issue and the solution? We have the same issue. Thanks, Jakub
  15. Hi @Lorenzo Angeli, reset helped out . I'm a little bit afraid that something bad will happen when 100 replies will be added at once... Thanks! Jakub