Mike Posted June 21, 2016 Report Posted June 21, 2016 Whenever I set a new location for the FTRACK_EVENT_PLUGIN_PATH I lose all actions within connect. I can't figure out how to append to the default location on Windows and I can't remember where I found an earlier example, but that example didn't work for me. The example in the docs used 'export' as to append a custom plugin location. -Mike
tokejepsen Posted June 21, 2016 Report Posted June 21, 2016 Hey Mike, You should add to FTRACK_CONNECT_PLUGIN_PATH, and make sure your actions are setup correctly. Have a look at these docs; http://ftrack-connect.rtd.ftrack.com/en/latest/using/plugin_directory.html and http://ftrack-connect.rtd.ftrack.com/en/latest/developing/plugins.html#developing-plugins
Mike Posted June 21, 2016 Author Report Posted June 21, 2016 Thanks for the response, tokejepsen! What about the FTRACK_EVENT_PLUGIN_PATH though? I'm trying to do this test from the ftrack_api docs: http://ftrack-python-api.rtd.ftrack.com/en/latest/understanding_sessions.html?highlight=plugin_path#configuring-plugins. Also, it looks like a lot of the 'ftrack connect latest' docs have code related to the old API, any suggestions on how to translate that code to the new API (If that's even necessary)?
tokejepsen Posted June 21, 2016 Report Posted June 21, 2016 How are you adding the environment variable?
Mike Posted June 21, 2016 Author Report Posted June 21, 2016 4 minutes ago, tokejepsen said: How are you adding the environment variable? os.environ['FTRACK_EVENT_PLUGIN_PATH'] = os.path.join(ROOT_DIR, 'plugins', 'ftrack-plugins')
tokejepsen Posted June 21, 2016 Report Posted June 21, 2016 Try adding to the environment variable, instead of replacing it? os.environ['FTRACK_EVENT_PLUGIN_PATH'] += os.pathsep + os.path.join(ROOT_DIR, 'plugins', 'ftrack-plugins')
Mike Posted June 21, 2016 Author Report Posted June 21, 2016 I've tried that :/. I end up getting a KeyError. I don't think the env var exists at this point in the script.
tokejepsen Posted June 21, 2016 Report Posted June 21, 2016 I think I used to have it working with that. This is from an old commit, so might not be up-to-date, but try adding the hook directory to the environment variable to force it to add the default actions as well. In the ftrack connect package it should be in the resources directory, so something like this; "[ftrack-connect-package]\resource\hook"
Mike Posted June 21, 2016 Author Report Posted June 21, 2016 it worked! thanks os.environ['FTRACK_EVENT_PLUGIN_PATH'] = os.path.join(ROOT_DIR, 'dependencies', 'ftrack_connect', 'resource', 'hook') os.environ['FTRACK_EVENT_PLUGIN_PATH'] += os.pathsep + os.path.join(ROOT_DIR, 'plugins', 'ftrack-plugins')
Mattias Lagergren Posted June 22, 2016 Report Posted June 22, 2016 Hey Mike, The recommended way would be to use FTRACK_CONNECT_PLUGIN_PATH and structure your plugins according to: http://ftrack-connect.rtd.ftrack.com/en/stable/developing/plugins.html This should also support location configuration from the new api. The hook folders are automatically added to the event plugin path in Connect. Let me know if this does not work for you. Setting the FTRACK_EVENT_PLUGIN_PATH does work but is overkill for many situations. Also, just be aware that the standard publisher in Connect is using the legacy api, so you'll need a legacy api representation of the Location plugin if you want to publish with the Connect publisher. Let us know how things goes!
Mike Posted June 22, 2016 Author Report Posted June 22, 2016 6 hours ago, Mattias Lagergren said: Also, just be aware that the standard publisher in Connect is using the legacy api, so you'll need a legacy api representation of the Location plugin if you want to publish with the Connect publisher. What do you mean by 'a legacy api representation'? Does that mean organize my project files like so: or use this type of code: import ftrack def register(registry, **kw): '''Register plugin.''' # Validate that registry is the correct ftrack.Registry. If not, # assume that register is being called with another purpose or from a # new or incompatible API and return without doing anything. if registry is not ftrack.LOCATION_PLUGINS: # Exit to avoid registering this plugin again. return ftrack.ensureLocation('studio.location') # Create a location instance location = ftrack.Location( 'studio.location', accessor=ftrack.DiskAccessor( prefix='C:/Users/mb/Desktop/_FtrackTest' ), structure=ftrack.IdStructure(), priority=5 ) registry.add(location)
Mattias Lagergren Posted June 23, 2016 Report Posted June 23, 2016 I meant the second one, that for Connect publish dialog to work you need to have a location plugin for the legacy api as we haven't switched over to the new ftrack-python-api. And the first one you mention on how to organise your plugin is also good, with separate action and location folders. That way you can let Houdini know about your location, without it registering you launch houdini hook from inside houdini.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.