L Smallwood

  • Content Count

  • Joined

  • Last visited

About L Smallwood

  • Rank

Recent Profile Visitors

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

  1. Hi all, In some cases, I am constructing (or querying) URLs to point to specific asset versions, like so: https://ftrack.myserver.com/#slideEntityId=7581acc1-3344-4376-b846-fab9d1c69a94&slideEntityType=assetversion&view=tasks&itemId=projects&entityId=4a6cd680-129b-11e8-849a-021590fc46df&entityType=show The ftrack system uses specific entity IDs in the URL. I was wondering if there is any way to construct a URL that points to the latest version of a particular asset type? For example, I want to get the latest "Maya scene" version of asset "table". Is it at all possible to resolve to that asset version in ftrack, using a URL, that doesn't embed specific IDs in the URL? Cheers, Lori
  2. Hello, I'm having trouble getting ftrack Connect to resolve component paths in the UI. It's not adding the prefix that I have specified in the custom location I've set up in System Settings. There are no errors in the ftrack_connect.log file. A few relevant bits of info: - Running on Mac OSX - Using ftrack Connect 1.1.3 - We are using rez for package management. I am launching ftrack Connect after setting the rez environment by executing "open -a" on the ftrack_connect.app directory, rather than double-clicking on it in the finder. - I do have a simple custom location plugin specified. I have a connect_plugin_hook.py file that is based off this tutorial example: http://ftrack-connect.rtd.ftrack.com/en/stable/developing/tutorial/adding_a_location.html - The connect_plugin_hook.py and the custom location code (configure_location.py) are both in the same directory. - I've set the following environment variables to all point to the directory containing connect_plugin_hook.py and configure_location.py: FTRACK_CONNECT_PLUGIN_PATH, FTRACK_EVENT_PLUGIN_PATH, FTRACK_LOCATION_PLUGIN_PATH. (Just trying to keep things simple for now) I can tell from the log file that the "register" function in connect_plugin_hook.py is called, it is importing my configure_location.py code successfully and registering that, but the modify_application_launch procedure in connect_plugin_hook.py is never getting called. Could there be a problem with the event listener? My code for subscribing to the event is identical to the example: def register(session, **kw): '''Register plugin to session.''' # 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 logger.info('Connect plugin discovered.') import configure_location configure_location.register(session) session.event_hub.subscribe( 'topic=ftrack.connect.application.launch', modify_application_launch ) Are there problems with my setup that you can tell from my description? Where else can I look to find out what is going wrong? Thanks a bunch! -- Lori
  3. Hi Lorenzo, Thanks for your message but unfortunately that doesn't address my specific problem. The issue is that I'm trying to use the ftrack_api and ftrack-connect together, and they don't seem to want to cooperate. See my post from March 2 - it describes the problem. Has anyone here on this forum successfully used the API in conjunction with ftrack-connect functionality? -- Lori
  4. Is anyone available to help me troubleshoot the problems I'm having with getting the ftrack API code and ftrack-connect running at the same time?
  5. I'm still having a bit of trouble getting the API and Connect to work in the same environment. Here's what I've done so far: - Put all my plugin code in the same directory in order to try to simplify things. This includes: connect_plugin_hook.py -- modified LOCATION_DIRECTORY to point to the directory containing configure_location.py (i.e. the same directory as connect_plugin_hook) configure_location.py -- contains the register code and a CustomStructure class derived from ftrack_api.base.structure.Structure. The ftrack_api.mixin(...) line is commented out. - I managed to get the ftrack-connect source code installed and have added the "/FtrackConnectLocation/ftrack-connect/lib" subdir to the PYTHONPATH When I create an ftrack_api.Session in the Python session, I get a warning message: 'WARNING:ftrack_api.plugin.discover:Failed to load plugin from "/MyCodeLocation/connect_plugin_hook.py": No module named ftrack'. Should I be concerned? When I publish code via the API, the file will be copied to the correct, custom location as defined by configure_location.py. It will show up in the Web UI correctly only if ftrack-connect is running. When I launch ftrack-connect from my modified shell (the one that has the ftrack-connect source code path in the PYTHONPATH), the location plugin does get registered successfully, and any published files go to the correct, custom location. However, the web UI is not reflecting the filesystem prefix -- just like if I'd published files via the API without ftrack-connect running. Is that because I'm running ftrack-connect directly from a terminal prompt? I wonder if there's some disconnect between ftrack-connect and the Web UI in that case. Finally, I've noticed that if I create assets/assetversions in the API, those entities will not be reflected in the "Existing asset" drop down in ftrack-connect. It seems to maintain a separate list of assets and versions them up separately, and independent of the assets published via the API. Both streams of assets show up in the Web UI, which makes it look like there are duplicate asset versions published to a task. Do you know what's going on there? Is the fact that I'm launching ftrack-connect from a terminal prompt causing the screwiness? Thanks!
  6. Great, thanks for the clarification. After much tweaking yesterday, I managed to get the files publishing to the right place and the web UI showing the proper location of the published files. (I'm not sure which tweak eventually did the trick). I'd like to get both scenarios working - publish via a script and publishing to a custom location via connect. I'm trying to get your connect plugin example working and am having a little trouble, I think with the pathing/env var setup. I put your example connect_plugin_hook in a directory in my code repo and changed it to point to my custom configure_location code. I then modified the FTRACK_CONNECT_PLUGIN_PATH in the shell to point to that directory. I also modified the FTRACK_EVENT_PLUGIN_PATH to point to my custom location code (which now works fine in a Python session). When I launch ftrack-connect from that shell, I get an error: "No module named configure_location." So, it's finding connect_plugin_hook, but not configure_location. What env vars need to be populated in order for ftrack-connect to pick up both the connect hook and custom locations dev code? Perhaps what I'm doing is not a valid workflow, and there's a better way to launch ftrack-connect from a dev environment. Any tips? I'm on a Mac. Cheers!
  7. Hello, I'm trying to get a location plugin working, as described in this forum post. The example pointed to by Mattias requires an "ftrack_connect" module to be imported, which is not found on my system (Mac OS). I tried installing the source code from here: http://ftrack-connect.rtd.ftrack.com/en/stable/installing.html but ended up going down a rabbit hole of missing dependencies and version conflicts and so far, have not been able to install it successfully. Is it necessary to install the source code as described on the "installing" web page or should my system be able to find the ftrack_connect module after installing ftrack connect from the integrations webpage (https://www.ftrack.com/en/portfolio/connect)? Thanks!
  8. Thanks Anthony - I tried that but I'm having some real trouble installing ftrack_connect on my system. I'm able to install the UI from this page: https://www.ftrack.com/en/portfolio/connect and run it. Unfortunately I don't seem to be able to "import ftrack_connect" in a Python session, which is causing Mattias's example plugin to error. I'll start a new topic with this new problem. I'm still hoping for some clarification from Mattias about whether it's necessary to go through ftrack_connect or not. It's not clear from the locations documentation that ftrack_connect is a requirement. Thanks for your help!
  9. So far I've just been trying to use the API. Am I required to use the Connect method if I want to publish files? I can't really tell from your example if I should be using the API method, the Connect method, or both. Your custom_location_plugin code looks almost identical to mine, above. My location plugin is getting registered successfully, and the paths are being built properly when I run the code interactively in a Python session. However the files are not getting copied to the server, and the Web UI is not picking up the prefix. Can you tell me where I"m going wrong?
  10. As a temporary hack, just so I can try to keep making progress, I added the prefix in my CustomLocation class. The full path now shows up in the web UI, but it still appears in red and the file is still not copied to the file system. Any advice appreciated! Cheers, Lori
  11. Hello, I have built a custom locator plugin and am trying to use it to publish files to my project. Everything is working brilliantly except for the DiskAccessor piece. Although in code, the path to the component is being built correctly, the prefixes I'm specifying with my DiskAccessor are not appearing in the web UI. I'm getting a partial path to the file in the UI, and the file is not being copied to the filesystem. I'll include portions of my plugin code below. In my Python terminal, when I test my code, I get accurate results: location = session.query('Location where name is "lsmallwood.test"').one() location.accessor.prefix prints "/Volumes/MyCustomLocation/Assets" as expected. If I have a FileComponent "c" which I've published, and I print out its path like so: location.get_filesystem_path(c) prints "/Volumes/MyCustomLocation/Assets/custom/path/to/asset/file" as expected. However in the web UI, I'll only see "custom/path/to/asset/file". Here's my plugin code. Any ideas why the prefix I'm specifying with DiskAccessor isn't working? Thanks a bunch! def get_prefix(): prefix = '' this_sys = platform.system() if this_sys == 'Windows': prefix = 'Z:\Assets' elif this_sys == 'Darwin': prefix = '/Volumes/MyCustomLocation/Assets/' else: print 'This location plugin is not configured for system {}'.format(this_sys) return prefix def register(session): logger = logging.getLogger('ftrack_plugin:configure_location.register') # 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): logger.debug( 'Not subscribing plugin as passed argument {0!r} is not an ' 'ftrack_api.Session instance.'.format(session) ) return logger.info('Registering configure-location plugin') def configure_locations(event): '''Configure locations for session.''' session = event['data']['session'] # Find location(s) and customise instances. location = session.query('Location where name is "lsmallwood.test"').one() ftrack_api.mixin(location, ftrack_api.entity.location.UnmanagedLocationMixin) location.accessor = ftrack_api.accessor.disk.DiskAccessor(prefix=get_prefix()) location.structure = CustomStructure() location.priority = 50 session.event_hub.subscribe( "topic=ftrack.api.session.configure-location", configure_locations ) class CustomStructure(ftrack_api.structure.base.Structure): # My CustomStructure class is a copy of StandardStructure which has a very lightly # modified variation of the get_resource_identifier procedure.
  12. Hi Lucas, My code was using ftrack.getProject() to get the project entity, then looping through the asset builds using getAssetBuilds() to find the necessary assets to link. Then I was trying to link those AssetBuilds (which show up as "task" objects in the back end like I mentioned) using the call to session.create('TypedContextLink'). Looks like I'll need to use session queries instead. I'll give that a try, and if I have more difficulty I'll post to the API forum. Thanks for your help. -- Lori
  13. Hi Mattias, Our ftrack version has been upgraded to, and now I'm getting a different error with the same code I was running before: that the asset build object (which shows up as a "task" type in the back end) is not JSON serializable. The documentation states that Since both of the objects I'm linking are tasks, I would expect them to link successfully as TypedContextLinks. Are there further restrictions on linking than what's outlined in the docs? Thanks, Lori
  14. Thanks Mattias - I'll see about getting us upgraded to the latest version.
  15. Hi all, I'd like to create a custom location structure, and am having a little trouble finding information on how to go about it. Essentially, I'm creating a list of assets within a project, and I'd like to flip the directory structure around so that the project directory is inside the asset directory on the filesystem. Ftrack stores the files like this by default: MyProject1/ MyAssetBuild1/ MyAssetBuild2/ MyAssetBuild3/ MyProject2/ MyAssetBuild1/ MyAssetBuild2/ MyAssetBuild3/ I want to do this: MyAssetBuild1/ MyProject1/ MyProject2/ MyAssetBuild2/ MyProject1/ MyProject2 MyAssetBuild3/ MyProject1/ MyProject2/ From this post it seems I can inherit from ftrack_api.structure.base.Structure, but I can't sort out from that post how to assemble my own directory structure. This post also seems to indicate that it's possible, but the location docs it points to doesn't describe exactly how to do it. Is what I'm asking for possible with the current API? If so, is there a doc or forum post that describes what to override in ftrack_api.structure.base.Structure? If I need to crack open the code and sort it out myself, I'm happy to, but I thought there might be some docs somewhere that I've overlooked. Thanks for any help! -- Lori