• Content Count

  • Joined

  • Last visited


  • Rank

Recent Profile Visitors

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

  1. I'm writing an action script that get as input all tasks whose parent(Asset Build) have a specific value in a custom attribute. Ideally, the right value of the custom attribute would be found in the Filter button/option from the site. The first problem is that i want to be able to query all tasks that have the right filter value using the API's expression language. Something like this: filtered_value = ??? #somehow get the filter from the site list_of_tasks = session.query('Task where parent.custom_attributes.my_custom_attr is {0}'.format(filtered_value)).all() The second problem is that the custom attribute is actually a list so in the query expression i need to be able to do something like this: list_of_filtered_values = ??? #somehow get the filters from the site for value in list_of_filtered_values: #get all tasks that have the value in the custom attribute list. list_of_tasks = session.query('Task where {0} in parent.custom_attributes.my_custom_attr'.format(value)).all() #Do stuff As of right now i'm having to query all task from the project and check which ones have the right value(i get the value from the task where the action was triggered) and then apply my action with it. It's a very inefficient approach since the project has lots of tasks(and it will have more in the future) and Python is not very fast at looping around huge lists. My code right now looks like this: right_value = entity.get("my_custom_attr") tasks = session.query('Task where parent.object_type.name is "Asset Build" and project.name is "my_project"').all() for task in tasks: if episode not in task["parent"]["custom_attributes"]['my_custom_attr']: continue else: #do_stuff Is there a better solution? Thanks!
  2. version:
  3. The one that comes with the lastest version of ftrack connect.(3.3.11+)
  4. Hi i just followed the current example but the key ['task_templates'] don't exist inside project['project_schema'].In the site i have access to those task templates but i can't find them via the python api.
  5. I tried to create an Asset,make the shot be the parent of it and send the asset to that function but the same error is happening. Here is the code: shot = session.query("Shot where name is \"" + "EP101_SHOT0010" + "\"").first() newAsset = session.create("Asset",{'name': "101_010",'type': "Shot",'parent': shot}) task = session.query("Task where parent.name is \"" + "EP101_SHOT0010" + "\"").first() sendVideo(newAsset,task) #same function as in OP. Any idea of what is missing? thanks! Ottoni.
  6. Oh yeah "asset" is actually shot. My function actually receive the shot from outside but to simplify the OP sample i put it inside the function and forgot to change the name. I'm going to edit the OP.
  7. Hi! I'm trying to send a .mov video of a shot to ftrack using the python api but i'm having some problems my code: def sendVideo(asset,task): version = session.create('AssetVersion', {'asset': asset,'task': task}) server_location = session.query('Location where name is "ftrack.server"').one() filepath = "my/path/to/videos/101_010.mov" component = version.create_component(path= filepath ,data={'name': '101_010.mov'}, location= server_location) shot = session.query("Shot where name is \"EP101_SHOT0010\"").first() task = session.query("Task where parent.name is \"EP101_SHOT0010\"").first() sendVideo(shot,task) but when i try to run this code i get this error at the last line: ftrack_api.exception.LocationError: Failed to register components with location <ServerLocation("ftrack.server", 3a372bde-05bc-11e4-8908-20c9d081909b)> due to error: Server reported error: KeyError('versions') Transferred component data that may require cleanup: [(<dynamic ftrack FileComponent object 2158043712>, '29715fa3-488c-46d2-9d3d-677711776c7d')] I'm following this tutorial here: http://ftrack-python-api.rtd.ftrack.com/en/stable/example/web_review.html Do you guys have an idea of what can it be? Thanks. Ottoni.
  8. Thanks that gave me some insight about actions. What i really need though is to understand how to integrate my plugins with ftrack connect. For instance, i have a hiero plugin that i want to be load when users launch hiero/nuke studio from both connect and the site. I'm following this page's example: http://ftrack-connect.rtd.ftrack.com/en/latest/developing/tutorial/adding_a_location.html i came up with this: def my_callback(event): environment = event['data']['options']['env'] ftrack_connect.application.appendPath("<my-plugin-path>",'HIERO_PLUGIN_PATH',environment) def register(session, **kw): '''Register action in Connect.''' # Validate that session is an instance of ftrack_api.Session. If not, assume # that register is being called from an old or incompatible API and return # without doing anything. if not isinstance(session, ftrack_api.Session): return session.event_hub.subscribe('topic=ftrack.connect.application.launch',my_callback) problem is, i need my plugin to know what entity launched hiero(My plugin needs to know what project it is working with for example) and i don't know how to send the context to my plugin. I know how to create a new session and recently learned that you can call get_shared_session() from ftrack_connect.application which i believe give me the session that launched the program from connect but not the context. Can you help me with that? Thanks for the help.
  9. Hi Thanks i was able to solve this problem. But i still don't understand how can i have my own version of your plugins. Let say i want to modify your nuke studio plugin without changing your code. How do i register to connect that it should use my scripts(in some folder in my system) instead of yours(in ftrack_connect)? Thanks.
  10. Hi! I trying to learn how to make my own hooks/actions and i'm following this tutorial: http://ftrack-connect.rtd.ftrack.com/en/stable/developing/tutorial/custom_applications.html After creating a houdini hook the tutorial says i have to override some ftrack modules that,in my case, are zipped in C:\Program Files (x86)\ftrack-connect-package-0.6.2/common.zip. Thing is, i don't want to risk ovewritting the base code(especially because i'm just learning how it works) so my question is: is there a way to make a modified version of the default python scripts (like ftrack_connect.application.ApplicationStore for example) and how do i make the connect know that it should use my version instead of the default one? thanks!