Jump to content

tokejepsen

Members
  • Posts

    305
  • Joined

  • Last visited

  • Days Won

    27

Everything posted by tokejepsen

  1. Dont think its possible through the UI. For API you can reference this: https://github.com/tokejepsen/ftrack-hooks/tree/master/batch_create
  2. tokejepsen

    Memory leak

    That did the trick! Thanks @Julian Martinz
  3. tokejepsen

    Memory leak

    There seems to be some issues with caching with this approach. Take this example and replace the task id; import functools import ftrack_api def callback(session, event): task = session.get("Task", "ab3234f0-46a2-11ea-95c7-92527973a98f") print(task["status"]["name"]) print(task["status"]["id"]) session = ftrack_api.Session(auto_connect_event_hub=True) handler = functools.partial(callback, session) session.event_hub.subscribe("topic=ftrack.update", handler) session.event_hub.wait() On initial run, it prints the correct status but on subsequent runs it prints the same status. Tried various "query" and getting the status by id, but nothing seems to get the updated status.
  4. tokejepsen

    Memory leak

    Using partial to reuse the same session works! The memory footprint does not increase, in the simple test case in the original post.
  5. tokejepsen

    Memory leak

    Good point. Havent been able to trace down the memory leak, so if you have some pointers that would be great!
  6. tokejepsen

    Memory leak

    Hey Steve, I tried 1.8.2 and it does not fix our issue. Since other people are not experiencing the same thing, I'm suspecting it might be our environment. Would greatly appreciate if someone could test on their end with this (conda) environment? name: ftrack-pipeline-environment channels: - defaults dependencies: - certifi=2019.6.16=py27_0 - pip=19.1.1=py27_0 - python=2.7.16=hcb6e200_0 - setuptools=41.0.1=py27_0 - sqlite=3.29.0=h0c8e037_0 - vc=9=h7299396_1 - vs2008_runtime=9.00.30729.1=hfaea7d5_1 - wheel=0.33.4=py27_0 - wincertstore=0.2=py27hf04cefb_0 - pip: - arrow==0.14.2 - backports-functools-lru-cache==1.5 - cachetools==3.1.1 - chardet==3.0.4 - clique==1.5.0 - ftrack-python-api==1.8.2 - google-api-python-client==1.7.9 - google-auth==1.6.3 - google-auth-httplib2==0.0.3 - google-auth-oauthlib==0.4.0 - httplib2==0.13.0 - idna==2.8 - jsondiff==1.2.0 - oauthlib==3.0.2 - pyasn1==0.4.5 - pyasn1-modules==0.2.5 - pyparsing==2.4.0 - python-dateutil==2.8.0 - requests==2.22.0 - requests-oauthlib==1.2.0 - rsa==4.0 - six==1.11.0 - slacker==0.9.65 - slacker-log-handler==1.7.1 - termcolor==1.1.0 - uritemplate==3.0.0 - urllib3==1.25.3 - websocket-client==0.56.0 prefix: C:\Users\admin\miniconda\envs\ftrack-pipeline-environment
  7. tokejepsen

    Memory leak

    Hey, I've been trying to figure out why our Ftrack event listener machine is running out of memory. Seems like the event listener is holding onto something, so it does not get garbage collected. Take a simple event listener like this: import ftrack_api def test(event): session = ftrack_api.Session() session = ftrack_api.Session(auto_connect_event_hub=True) session.event_hub.subscribe("topic=ftrack.update", test) session.event_hub.wait() It initially starts at 27 Mb, but with every ftrack event that triggers it, a couple of Mb get added. It never gets back down to 27 Mb. Anyone experiencing the same?
  8. +1 Would this work for remote instances of Ftrack Connect as well? Say you are logged into Ftrack Connect on two machines in different locations. Use case that was happened for me
  9. Should have investigated it deeper. The event from hitting "Submit" on the dialog has a topic of "ftrack.action.launch" with the values in it. Might be nice to update the documentation with this information. import getpass import ftrack_api from ftrack_connect.session import get_shared_session def callback(event): """Status change updates.""" session = get_shared_session() for entity_data in event["data"].get("entities", []): if entity_data["action"] != "update": continue if "statusid" not in entity_data["keys"]: continue new_status = session.get( "Status", entity_data["changes"]["statusid"]["new"] ) # Task changes if entity_data["entityType"] == "task": if new_status["name"] == "In Progress": event = ftrack_api.event.base.Event( topic='ftrack.action.trigger-user-interface', data={ 'type': 'form', 'items': [ { 'label': 'My Boolean', 'name': 'my_boolean', 'value': True, 'type': 'boolean' } ], 'title': 'Foobar' }, target=( 'applicationId=ftrack.client.web and ' 'user.id={0}'.format( event['source']['user']['id'] ) ) ) session.event_hub.publish(event) session.commit() def action_launch(event): print event def register(session, **kw): """Register event listener.""" # Validate that session is an instance of ftrack_api.Session. If not, # assume that register is being called from an incompatible API # and return without doing anything. if not isinstance(session, ftrack_api.Session): # Exit to avoid registering this plugin again. return # Register the event handler subscription = ( "topic=ftrack.update and source.applicationId=ftrack.client.web and " "source.user.username={0}".format(getpass.getuser()) ) session.event_hub.subscribe(subscription, callback) subscription = ( "topic=ftrack.action.launch and " "source.user.username={0}".format(getpass.getuser()) ) session.event_hub.subscribe(subscription, action_launch)
  10. Thanks Mattias I've used the shared session from ftrack-connect, and that works well. Now the question is how do you intercept the "Submit" event? Normally you look for "values" in the same event.
  11. Hey Mattias, Tried getting the examples running, but couldn't so wanted to see if you could correct my example code? import getpass import ftrack_api def callback(event): """Status change updates.""" session = ftrack_api.Session() for entity_data in event["data"].get("entities", []): if entity_data["action"] != "update": continue if "statusid" not in entity_data["keys"]: continue new_status = session.get( "Status", entity_data["changes"]["statusid"]["new"] ) # Task changes if entity_data["entityType"] == "task": if new_status["name"] == "In Progress": event = ftrack_api.event.base.Event( topic='ftrack.action.trigger-user-interface', data={ 'type': 'form', 'items': [ { 'label': 'My Boolean', 'name': 'my_boolean', 'value': True, 'type': 'boolean' } ], 'title': 'Foobar' }, target=( 'applicationId=ftrack.client.web and ' 'user.id={0}'.format( event['source']['user']['id'] ) ) ) session.event_hub.publish(event) session.commit() def register(session, **kw): """Register event listener.""" # Validate that session is an instance of ftrack_api.Session. If not, # assume that register is being called from an incompatible API # and return without doing anything. if not isinstance(session, ftrack_api.Session): # Exit to avoid registering this plugin again. return # Register the event handler subscription = ( "topic=ftrack.update and source.applicationId=ftrack.client.web and " "source.user.username={0}".format(getpass.getuser()) ) session.event_hub.subscribe(subscription, callback) When a task's status is set to "In Progress" this code should show a form for the user to interact with.
  12. Could you elaborate on this? Trying to trigger an action dialog from a custom published event, and can't seem to get it to work.
  13. That's cool. I working around the UI problem with just having a PySide dialog for user input instead.
  14. When listening to the event topic "ftrack.connect.application.launch", I can't seem to display any UI elements. Is this supposed to work? Maybe you could provide an example?
  15. Hey, We work with having different components on each asset version. This means there aren't always a "main" component which ftrack-connect-rv is looking for to play. I would like to see the ability to load in different components than the "main" one.
  16. Hey @TTT This may help as a starting point for the action you want to build; https://github.com/tokejepsen/ftrack-hooks/blob/master/ftrack_connect_hooks/hook/review_sort.py
  17. I don't know about AE and Photoshop, but its definitely possible with Nuke and Maya with an event plugin like this; https://github.com/tokejepsen/ftrack-hooks/blob/master/ftrack_connect_hooks/hook/app_launch_open_file.py. You'll of course need to implement your own logic for getting the path to the files.
  18. Being able to change the time log for other people as a supervisor or coordinator would be good.
  19. I have to say that this update to the connect system is a pure blessing! Thanks guys for this. It very pleasant to have all the launching of the applications separate from the scene file and environment logic.
  20. Is there any problems with using FTRACK_EVENT_PLUGIN_PATH? Its pretty convenient to have a flat hierarchy of files for all the custom hooks.
  21. Also you suggest in; http://ftrack-connect.rtd.ftrack.com/en/0.1.21/using/plugin_directory.html, to use FTRACK_CONNECT_PLUGIN_PATH, but I can't get that to work. I'm currently using FTRACK_EVENT_PLUGIN_PATH. Which is the correct one?
  22. I have been playing around with this now, and I've got some feedback. In the example; http://ftrack-connect.rtd.ftrack.com/en/0.1.21/developing/tutorial/adding_a_location.html#developing-tutorial-adding-a-location-modifying-application-launch, you use the "appendPath" method from ftrack_connect.application, but shouldn't this be returning the launch data instead? I've tried getting the "launchArguments" working, but I can't. It seems to me that you aren't using the returned launch arguments here; https://bitbucket.org/ftrack/ftrack-connect/src/06eaec219026c9b973f9031040d0cc0199c05f4c/source/ftrack_connect/application.py?at=master&fileviewer=file-view-default#application.py-337 Lastly I was wondering whether you could publish an event that has the process pid, so we could monitor it? https://bitbucket.org/ftrack/ftrack-connect/src/06eaec219026c9b973f9031040d0cc0199c05f4c/source/ftrack_connect/application.py?at=master&fileviewer=file-view-default#application.py-359
  23. Maybe the nice people at Ftrack could emit a signal when the process has terminated?
  24. BTW make sure you use this http://ftrack-python-api.rtd.ftrack.com/en/latest/api_reference/entity/location.html?highlight=remove#ftrack_api.entity.location.Location.remove_component, instead of "session.delete".
×
×
  • Create New...