Jump to content

Setting FTRACK_EVENT_PLUGIN_PATH without writing over default plugin location


Mike

Recommended Posts

Posted

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

 

Posted

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)?

Posted
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')

 

Posted

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"

Posted

it worked! thanks :D

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')
Posted

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!

Posted
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:

projectHi2.JPG

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)
Posted

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...