YuChen
Members-
Posts
19 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
YuChen's Achievements
-
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.
-
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 ?
-
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 ?
-
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 ?
-
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
-
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.
-
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.
-
dario.siero reacted to a post in a topic: Is "ftrack_connect.application" module not available in ftrack connect ?
-
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 ?
-
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
-
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 ?
-
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 ?
-
How to make time logger just show today's logging info ?
YuChen posted a topic in General discussion
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 ? -
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 ?