Jump to content

YuChen

Members
  • Posts

    19
  • Joined

  • Last visited

Everything posted by YuChen

  1. Hi support team, I tried to export the shots table under "Tasks" panel to an Excel file and expect the thumbnail image of each shot would appear in first column. Of course this doesn't happen and it looks like this only happens when exporting table as a PDF file. I was wondering if there's any ftrack API that can help customize exporting behavior. Do we have any API that can help ? Thanks.
  2. Hi all, I mis-delete an "animation" Task but I found all the AssetVersion under it are still alive on Ftrack. I wonder if it's possible to create another "animation" Task and add all AssetVersion objects back to this new animation task (either by GUI or python code) ? Thanks.
  3. Hi @Patrick Boucher, Thanks for the reply first. Here comes an advanced request and I'm not sure if ftrack already provide this function. We would like to give team leaders the capability to delete any asset version entity, but we don't want individual artist to be able to delete anything not published by themselves (i.e. they could only delete asset versions published by themselves). Is it possible to organize the permission rule in this way ?
  4. Hi all, I have had an asset entity named "ddd" related to a shot entity and would like to create another asset entity "DDD" (i.e. the same name but convert to uppercase): import ftrack_api session = ftrack_api.Session(auto_connect_event_hub=True) cache = session.query('AssetType where name is "Cache"').one() shot = session.get('Shot', '79336930-e883-11ec-ac4e-5e4cc4698f5e') asset_args_dict = {'name': 'DDD', 'type': cache, 'parent': shot} new_asset = session.create('Asset', asset_args_dict) session.commit() I expected it should work but got a duplicate entry error: Server reported error: IntegrityError((MySQLdb._exceptions.IntegrityError) (1062, "Duplicate entry '55db6728-0392-11e9-8a89-6c626de13dde-DDD-79336930-e883-11ec-a...' for key 'asset_Asset.typeid_key'") [SQL: u'INSERT INTO asset (id, name, context_id, taskid, type_id) VALUES (%s, %s, %s, %s, %s)'] [parameters: (u'fbb10a03-e1b9-446b-b933-4100cb58ec0c', 'DDD', u'79336930-e883-11ec-ac4e-5e4cc4698f5e', None, u'55db6728-0392-11e9-8a89-6c626de13dde')] (Background on this error at: http://sqlalche.me/e/gkpj)) Traceback (most recent call last): File "L:/_temp/YuChen/dev/my_test/ftrack/simple_examples.py", line 2641, in <module> session.commit() File "L:\_temp\YuChen\dev\lib\twr_ftrack\common.zip\ftrack_api\session.py", line 1231, in commit File "L:\_temp\YuChen\dev\lib\twr_ftrack\common.zip\ftrack_api\session.py", line 1609, in _call ftrack_api.exception.ServerError: Server reported error: IntegrityError((MySQLdb._exceptions.IntegrityError) (1062, "Duplicate entry '55db6728-0392-11e9-8a89-6c626de13dde-DDD-79336930-e883-11ec-a...' for key 'asset_Asset.typeid_key'") [SQL: u'INSERT INTO asset (id, name, context_id, taskid, type_id) VALUES (%s, %s, %s, %s, %s)'] [parameters: (u'fbb10a03-e1b9-446b-b933-4100cb58ec0c', 'DDD', u'79336930-e883-11ec-ac4e-5e4cc4698f5e', None, u'55db6728-0392-11e9-8a89-6c626de13dde')] (Background on this error at: http://sqlalche.me/e/gkpj)) Closing session with pending operations not persisted. It looks like I can't create asset with the same name but different letter case. Is this an intentional design or is it a bug ?
  5. Hi all, We want to provide end-users the capability of deleting asset version entity only. This means they're not able to delete higher level entities like Task, AssetBuild and other hierarchical Folders. Is it possible to set ftrack web page in this way ?
  6. Hi, I noticed that we have Structure & ResourceIdentifierTransformer class defined inside two modules and their methods' name are a bit different: import ftrack_api.structure.Structure.base.Structure import ftrack_api.resource_identifier_transformer.base.ResourceIdentifierTransformer from ftrack import Structure from ftrack import ResourceIdentifierTransformer Some examples use first one to implement their custom structures & id transformers and others use another. Just wonder are they responsible for different scenarios ?
  7. Hi @Lorenzo Angeli Since "context['selection'][0]['entityType']" always gives out "task" string (only "assetversion" and "show" can be correctly recognized), the command you provided doesn't really work (test with ftrack-connect-package-1.1.2 & ftrack-connect-2.0.0 rc3). I think maybe some fixing are necessary forthis issue: 1. "context['selection'][0]['entityType']" need to provide correct selected entity type. 2. "context['selection'][0]['entityType']" need to provide a string started with capital letter. Now the "context['selection'][0]['entityType']" gives "task" which is started with lowercase alphabet and it can't be used directly in "session.get" function: my_selection = self.session.get( 'task', 'task_id' ) # This doesn't work my_selection = self.session.get( 'Task', 'task_id' ) # This works Not sure whether it's a bug or not but I guess these fixing could make workflow more fluent
  8. YuChen

    Confused with Hook

    Hi all, I'm looking for a proper way to modify the default behavior of "ftrack.connect.publish.make-web-reviewable" event. According to the docuemnt, It looks like I can implement a custom hook to overwrite the default one (more implemetation details would be appreciated) http://ftrack-connect.rtd.ftrack.com/en/stable/developing/hooks/index.html I tried to find some references before getting start and I noticed that there're some built-in hooks in "Program Files(x86)\ftrack-connect-package-1.1.2\resource\hook" folder. But I got a bit confused after looking into these examples. They're not quite similar, in fact, I can categorize 3 plugin styles revealed in this hook folder, they 're: 1. Class with "__call__" method and a global "register" function. You can see examples like this in: DiscoverApplicationsHook & LaunchApplicationHook in application.py Resolver in resolver.py 2. No class defined, just have functions (looks like they all have "subscribe" & "register" functions), they're: make_web_playable.py publish_components.py ftrack_connect_package_version_information.py 3. Class with "discover", "launch", "register" functions and a global "register" function. All "ftrack_connect_[Application_Name]_hook.py" go in this way and I think this is the "standard" style of hook mentioned in document So here'are my questions: 1. Are all the python files in "hook" folder used as hook ? Is it possible to provide more details about why we have 3 different styles of hook ? 2. Which one should I use if I want to overwrite the response behavior of some system events (e.g. ftrack.connect.publish.make-web-reviewable, ftrack.connect.application.launch) 3. Do we have any example about overwrite system hook or cease some system hooks ? Thanks.
  9. Hi @Lorenzo Angeli Sorry not getting back to you sooner. I'm not allow to install Python 3 in company's machine so can not test with that issue. Please let me know if you need my testing file. Thanks.
  10. Hi, I found some of my tools disappear in "ftrack Connect-2.0.0rc3" due to unable to find "ftrack_connect.application" module. Most of them are application hooks since I need "ftrack_connect.application.ApplicationStore" and "ftrack_connect.application.ApplicationLauncher" in it. I'm a bit confused by the difference of "ftrack-connect-package-1.1.2" and "ftrack Connect-2.0.0rc3". Are they difference things ?
  11. Hi all, http://ftrack-connect.rtd.ftrack.com/en/stable/developing/tutorial/custom_applications.html I'm working on a custom application launcher mention in above link and noticed that "_getApplicationEnvironment" seems like not provide correct entity type for selected enity (in ftrack studio Web page). When I query entity type like this: def _getApplicationEnvironment(self, application, context=None): ... if context['selection']: entity_id = context['selection'][0]['entityId'] # entity ID is connect entity_type = context['selection'][0]['entityType'] # but entity type always return "task" I always got "task" for entity type. Should't it be the type corresponding to my selection
  12. Awesome ! Since "session.event_hub.connect" works so well, why we need "ftrack_api.Session(auto_connect_event_hub=True)" ? I mean, in what situation should I connect manually and others use auto connect ?
  13. Hi all, I wonder if there's any sesssion attribute I can use for checking connection to server have been made. "wait" function trick works, but I think there should be an elegant solution session = ftrack_api.Session(auto_connect_event_hub=True) session.event_hub.subscribe('topic=custom.test_event1', my_callback) custom_event = ftrack+api.event.base.Event(topic='custom.test_event1', data={}) session.event_hub.wait(duration=5) # Given enough time to connect to server session.event_hub.publish(custom_event) session.event_hub.wait(duration=5) # Given enough time to recieve the callback result Any suggestion ?
  14. Hi, By default the time logger panel shows all the time logging history and this would be a bit messy. Can I just make it shows today's time logging info ?
  15. Hi, I just found the revoke user security role example of this page doesn't work (for version 4.6.15): http://ftrack-python-api.rtd.ftrack.com/en/stable/example/security_roles.html An error says the "revoke_user_security_role" is an invalid actionand not sure if the document gives a wrong command. Also, the "session.call" doesn't work too, I think it should be "session._call". Are these issues just document error or there's any API update after version 4.6 ?
  16. Hi, What if I run a "session.encode_media()" command and not assign the encoded vidoe/image components to a asset version ? Are these components just pending on ftrack server ? or they'll be removed automatically (depend on whether have connection with any ftrack entity) ? If these components are just pending there, can I find and remove them ?
  17. Hi, I got some errors when running the examples provided by official tutor The first one is to append a reply to a note with this command: first_note_on_task.replies.append(reply) I got an error about "Note" object has no "replies" attribute. Another one is to create a note with label, a command likes this: note = task.create_note( 'New note with external category', author=user, labels=[label] ) An error it says "create_note()" got an unexpected keyword argument 'lables'. I wonder if version 4.6.15 has already supported both fucntions, or not ? One more question is about the comparison of Note's and "Lable" and "Category". They looks quite the same for me and wonder if there's any functional difference between them ? An example to demonstrate it would be very welcome. Thanks.
  18. Hi, I follow the example provided by tutorial document to create a CustomAttributeLinkConfiguration entity: shot_object_id = session.query('ObjectType where name is "shot"').one()['id'] sequence_object_id = session.query('ObjectType where name is "sequence"').one()['id'] session.create('CustomAttributeLinkConfiguration', { 'entity_type': 'task', 'object_type_id': sequence_object, 'entity_type_to': 'task', 'object_type_id_to': shot_object_id 'label': 'Master shot', 'key': 'master_shot', 'config': '{}', 'one_to_one': True, 'write_security_roles': [security_role], 'read_security_roles': [security_role] }) but got an error message: Entity type "CustomAttributeLinkConfiguration" not recognized. My ftrack is v.4.6.15. Does this version support "CustomAttributeLinkConfiguration" entity ?
×
×
  • Create New...