Jump to content

Evan Hale

Members
  • Posts

    11
  • Joined

  • Last visited

  • Days Won

    1

Evan Hale last won the day on February 27 2023

Evan Hale had the most liked content!

Evan Hale's Achievements

  1. Hello! We work with a lot of harmony scenes for our projects. Harmony scenes are directories made up of many files and subdirectories. We are running an on prem version of ftrack. Currently, we upload the location of the xstage (XML file that refers to the rest of the files) to an ftrack location using the disk accessor. This places all the xstages in the same directory, which mirrors the hierarchy in ftrack (Episode folder -> Act folder -> Scene folder -> Shot folder -> Task folder -> versions for example). We then use a script to copy the rest of the content in the harmony scene directory to this directory. Recently having multiple versions of a harmony scene in the same directory has been causing issues in Harmony so we would like to change the structure. We would like to have each harmony scene version uploaded to ftrack exist in a separate directory than previous versions. So for example, instead of having: Task Directory Version 1 xstage Version 2 xstage All supplemental harmony files... We would like to have: Task Direcory Version 1 Directory Version 1 xstage Supplemental harmony files... Version 2 Directory Version 2 xstage Supplemental harmony files... However, I don't believe I can import a directory as a component to ftrack, only a single file. Is it possible to circumvent this, or even more ideal modify my location to copy the entire harmony scene directory to the location but have the ftrack component point only to the xstage inside. I realize this is rather technical, apologies! Thanks!
  2. Hey Patrick, Sorry for the late response. I ended up doing exactly that and just filtering the events in the callback. I for the life of me cannot find the documentation where '<' and '>' operators can be used for filtering so maybe it was some old information or I am just going insane. Either way, I believe we are doing it the intended way in the callback now. Thank you!
  3. Hello, I am trying to understand how expressions work in regards subscribing to events. So far I have: session.event_hub.subscribe('topic=ftrack.update', handle_event) I am trying to filter an ftrack.update event to only capture when a status change occurs. I understand I can access the key value pairs in the event using "." notation. However whatever I try seems not to work. If my event looks like the one below how would I access "statusid" inside of "changes"? Or even "statusid" inside of "keys"? I am not sure how to navigate past the list that is "entities" or "keys". I also see in the api documentation that you can use ">" "<" operators. How would this work? I don't seem to be able to filter by length. TLDR: I want to filter the event subscription to only capture events with a status change. How would I do this? Thanks! "<Event"{ "id":"9573a292408342b580dacfb654dd8a45", "data":{ "entities":[ { "entity_type":"Task", "keys":[ "statusid" ], "objectTypeId":"11c137c0-ee7e-4f9c-91c5-8c77cec22b2c", "entityType":"task", "parents":[ { "entityId":"849a05ce-a267-11ed-8a5f-32d516aa59c4", "entityType":"task", "entity_type":"Task", "parentId":"7c90fdb0-a267-11ed-8d96-32d516aa59c4" }, { "entityId":"7c90fdb0-a267-11ed-8d96-32d516aa59c4", "entityType":"task", "entity_type":"Folder", "parentId":"829bf916-9cf5-11ed-b339-32d516aa59c4" }, { "entityId":"829bf916-9cf5-11ed-b339-32d516aa59c4", "entityType":"show", "entity_type":"Project", "parentId":"None" } ], "parentId":"7c90fdb0-a267-11ed-8d96-32d516aa59c4", "action":"update", "entityId":"849a05ce-a267-11ed-8a5f-32d516aa59c4", "changes":{ "statusid":{ "new":"44de097a-4164-11df-9218-0019bb4983d8", "old":"44ddd0fe-4164-11df-9218-0019bb4983d8" } } } ], "pushToken":"6902c5b6-a3f3-11ed-8a5f-32d516aa59c4", "parents":[ "7c90fdb0-a267-11ed-8d96-32d516aa59c4", "849a05ce-a267-11ed-8a5f-32d516aa59c4", "829bf916-9cf5-11ed-b339-32d516aa59c4" ], }, "topic":"ftrack.update", "sent":"None", "source":{ "target":"", "in_reply_to_event":"None" }">"
  4. Just updating as I make progress. I can see the location plugin registering in the logs and that it registers the location object (although it seems to do it twice): 2022-09-13 22:39:03,757 INFO MainThread (0026) fcp.managed_location - Connect plugin discovered 2022-09-13 22:39:04,087 INFO MainThread (0023) fcp.managed_location - Location: <Location("floyd.managed", 93f12b72-575d-484d-b372-ce6d4522bb18)> 2022-09-13 22:39:04,580 INFO MainThread (0023) fcp.managed_location - Location: <Location("floyd.managed", 93f12b72-575d-484d-b372-ce6d4522bb18)> However I am still unable to import from these locations. I even tried assigning the task to myself to see if it was a permission error or something. I also noticed when I did this it did not appear in the "My Tasks" tab of the extension: Here is my plugin code: import ftrack_api import os import sys import logging logger = logging.getLogger('fcp.managed_location') RESOURCE_DIRECTORY = os.path.abspath( os.path.join(os.path.dirname(__file__), '..', '..', 'resource', 'fcp-ftrack-locations') ) logger.info(f"Resource Directory: {RESOURCE_DIRECTORY}") if RESOURCE_DIRECTORY not in sys.path: sys.path.append(RESOURCE_DIRECTORY) from fcp.ftrack.locations import managed def configure_location(event): session = event['data']['session'] location = managed.get_managed_location(session) logger.info(f"Location: {location}") def register(session, **kw): if not isinstance(session, ftrack_api.Session): return logger.info("Connect plugin discovered") session.event_hub.subscribe( 'topic=ftrack.api.session.configure-location', configure_location ) and the get_managed_location method: def get_managed_location(session: ftrack_api.Session) -> ftrack_api.entity.location.Location: location = session.ensure('Location', {'name': 'floyd.managed'}) location.accessor = ServerAccessor(FILE_SERVER) location.structure = ProjectMapStructure(location.session) location.priority = 10 return location We have some custom logic with the ServerAccessor and ProjectMapStructure but get_managed_location works as intended in the multitude of other areas we use it so I doubt it has to do with that.
  5. Update: The plugin seems to work inside of AI, however I don't seem to be able to import from any locations other than ftrack.unmanaged, not even ftrack.server.
  6. Hello, I would love to get some assistance with ftrack Connect. We are trying to migrate to 2.0 after not making much use of the first version. One feature we would like to use is uploading to specific locations. It us unclear if/how this is possible however. I added a location using a location plugin but I am not sure how to specify what location ftrack connect is uploading to. In fact, it seems to always just upload to ftrack.unmanaged and keep my local filepath. Do I need to create a custom action for uploading to alternative locations outside of the action provided by ftrack connect or is there a way to specify where connect uploads to? Secondly, we would love to use the integrations with Adobe, and later on other software as well. But it is very unclear how this works. I downloaded the ftrack plugin for adobe and the connect plugin. I can start photoshop from connect but the ftrack plugin is not located in the adobe plugins list. I tracked it down under Window -> Extensions (Legacy) put it just comes up with an error screen saying Connect is not running even when it is. Clicking any of the links on the plugin (screenshot attached) does not seem to do anything either.
  7. Calling ftrack_api.Session(auto_connect_event_hub=True, **auth) fails at the "query_server_information" action call. It returns a 404 "Resource Not Found" html response. Ftrack is up and running and I can access it fine via the browser. I tried removing the event hub arg which made no difference. I am sure my creds are correct and tested the same call on a different server which worked fine. Logs attached. Server reported error in unexpected format. Raw error was: <!DOCTYPE html> <html> <head> <title>Server Error 404</title> <style type="text/css"> body { background: #282e34; color: white; color: rgba(255, 255, 255, 0.9); font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; font-size: 1.2em; font-weight: normal; line-height: 1.6; text-align: center; } h1 { font-size: 2.4m; font-weight: normal; margin-bottom: 0; color: #935ba2; } a { color: #935ba2; } #container { max-width: 600px; margin: 50px auto; } .footer { <div class="footer"> Please contact <a href="mailto:support@ftrack.com">support@ftrack.com</a> if the problem persists. </div> </body> </html> Traceback (most recent call last): File "C:\Users\ehale\.virtualenvs\ftrack-scripts-s-mYXya3\lib\site-packages\ftrack_api\session.py", line 1626, in call result = self.decode(response.text) File "C:\Users\ehale\.virtualenvs\ftrack-scripts-s-mYXya3\lib\site-packages\ftrack_api\session.py", line 1773, in decode return json.loads(string, object_hook=self._decode) File "C:\Python38\lib\json\__init__.py", line 370, in loads return cls(**kw).decode(s) File "C:\Python38\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Python38\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) Traceback (most recent call last): File "C:\Users\ehale\.virtualenvs\ftrack-scripts-s-mYXya3\lib\site-packages\ftrack_api\session.py", line 1626, in call result = self.decode(response.text) File "C:\Users\ehale\.virtualenvs\ftrack-scripts-s-mYXya3\lib\site-packages\ftrack_api\session.py", line 1773, in decode return json.loads(string, object_hook=self._decode) File "C:\Python38\lib\json\__init__.py", line 370, in loads return cls(**kw).decode(s) File "C:\Python38\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Python38\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "c:\Users\ehale\.vscode\extensions\ms-python.python-2022.12.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy\__main__.py", line 39, in <module> cli.main() File "c:\Users\ehale\.vscode\extensions\ms-python.python-2022.12.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 430, in main run() File "c:\Users\ehale\.vscode\extensions\ms-python.python-2022.12.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 284, in run_file runpy.run_path(target, run_name="__main__") File "c:\Users\ehale\.vscode\extensions\ms-python.python-2022.12.1\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 321, in run_path return _run_module_code(code, init_globals, run_name, File "c:\Users\ehale\.vscode\extensions\ms-python.python-2022.12.1\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 135, in _run_module_code _run_code(code, mod_globals, init_globals, File "c:\Users\ehale\.vscode\extensions\ms-python.python-2022.12.1\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 124, in _run_code exec(code, run_globals) File "c:\Users\ehale\Repos\ftrack\ftrack-scripts\ftrack-scripts\interactive.py", line 16, in <module> session = ftrack_api.Session(auto_connect_event_hub=True, **auth) File "C:\Users\ehale\.virtualenvs\ftrack-scripts-s-mYXya3\lib\site-packages\ftrack_api\session.py", line 237, in __init__ self._server_information = self._fetch_server_information() File "C:\Users\ehale\.virtualenvs\ftrack-scripts-s-mYXya3\lib\site-packages\ftrack_api\session.py", line 1340, in _fetch_server_information result = self.call([{'action': 'query_server_information'}]) File "C:\Users\ehale\.virtualenvs\ftrack-scripts-s-mYXya3\lib\site-packages\ftrack_api\session.py", line 1634, in call raise ftrack_api.exception.ServerError(error_message) ftrack_api.exception.ServerError: <exception str() failed>
  8. Documentation states this should return a percentage on sequence components. Instead, it appears to return a dictionary of all file components' availability. Is this the intended return and documentation is wrong? https://ftrack-python-api.rtd.ftrack.com/en/2.3.0/locations/tutorial.html
  9. Thank you! It was indeed a bizarre use case.
  10. I need to write a query that finds an object based solely on its id. I don't see any way to query all object types, is this possible?
×
×
  • Create New...